MaximG

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • in reply to: RowID parameter in addRowData does not function correctly #96180
    MaximG
    Participant

    Turns out this problem gets even more interesting. Realized that after all that I had forgotten that during my

    testing I added a column in the colModel as such

    {

    in reply to: Paging, Sorting and appending with Local Data #96179
    MaximG
    Participant
    in reply to: RowID parameter in addRowData does not function correctly #96178
    MaximG
    Participant

    Ok so I worked out what was going on.

    The problem is the $(“#tableSearch”).trigger(“reloadGrid”); method. However this must be called
    to enable paging to work with local data (It does work fine once this is called)

    The problem with the method is it causes a call to the addJSONData method which in turn contains the following line

    this is where the problem is. At this point whatever is set as your localreader id value is now
    being used rather then the original rowID value, hence since your object (in my case)
    doesnt contain the default value id a new rowid is generated and bammm your old values are
    thrown out.

    So basically the temp solution to this is to add the following to your original declaration

    in reply to: Paging, Sorting and appending with Local Data #96177
    MaximG
    Participant

    I can confirm without question that this is a bug. (Will post in bug forum)

    Still trying to work out how to fix it.

    Code to recreate problem:

    in reply to: Paging, Sorting and appending with Local Data #96167
    MaximG
    Participant

    After all that it doesnt work. It only worked with my test data as I was using integers for my IDs in my test.

    There appears to be some specialized code inside the addRowData method that (ONLY IN THE CASE OF LOCAL DATA) deletes the predefined key and sets it to the length of the data array. (I Could be wrong though – still testing where its happening exactly)

    This is the code here (at least I think)

    in reply to: Paging, Sorting and appending with Local Data #96166
    MaximG
    Participant

    OK so for anyone interested I ended up looking at the source code and worked it out….

    The first param of the addRowData method is actually the NAME of the id column in your dataset…

    So basically this is how you would do it…

    var data =

    in reply to: Paging, Sorting and appending with Local Data #96165
    MaximG
    Participant

    Thank you so much. I was unaware you could pass an array into that method.

    One last issue I am having with is how to pass in the IDs for each row.

    Passing an array of IDs to the .addRowData() method doesnt seem to work, nor does passing an ID parameter as part of the data definition. Could you advise what I might be doing wrong?

    Have tried…

    var data = [{

    in reply to: Paging, Sorting and appending with Local Data #96147
    MaximG
    Participant

    OlegK said:

    You can use addRowData method.

    Best regards
    Oleg

Viewing 8 replies - 1 through 8 (of 8 total)

Stay connected with us in your favorite flavor!