Problems getting all checked ids in a grid

Hi everyone!

we encountered a problem using dhtmlx grid library v.2.5. We have a grid with over 4000 entries and a checkbox column for associating these entries to another object using getCheckedRows() function of dhtmlxgrid for getting all marked ids and then sending the selected ids of the rows to the server where they will be parsed and associated/deassociated to the given object.

Now we encountered sometimes that all ids will be send to the server, resulting to have all persons associated as attendants to the object. After checking the backend a dozen times line by line, we are assuming that these ids can only come from the frontend, so if its not in the code below it can be only in “getCheckedRows”… It happend already 5 times so its not like a “shit happens” bug :wink:

The code constallation is:

By the way: JQuery is used as Javascript Framework

Someone haveving a suggestion to this strange problem ???

would be very pleased if so :wink:



Unfortunately we cannot reproduce this issue locally.

BTW to get all rows’ ids grid iterates through all rows (4000 entities) and checks each row if it checked or not. Isn’t it better to save row’s checked state at data base and use one simple query to fetch all checked rows ids? It will increase client side performance and avoid you of strange issue with getCheckedRows() method.

thank you for your quick response! :smiley:

We can not store them directly “on click” because we need a roleback mechanism. And the easiest way to provide it is by submitting them all at once. Normaly the amount of ids won’t be over 10 or 20, but already 5 times happend that all ids were provided from the frontend. The only point where these ids are “known” is at the grid so we assume that the POF must be there…

To precise the procedure:

  • We show a grid with eventually marked persons as attendants by a checked checkbox.
  • The user can select deselect person and click on “save”
  • All checked ids will be transmitted to the server.
  • The server checks wether the marked ids were already associated, added or remove and performes db updates.
  • In case of success we show the new grid to the user

any suggestion? again thank you for your help



getCheckedRows(col_ind) method works as expected at local example. We need any kind of sample where the issue will be reproduced.


what data do you need for reproduction? We have figured out that the problem is associated with an user interaction and has to be definitively in attendant.getCheckedRows(0). The following scenario will reproduce a “part” of the problem.


  1. You have a <form action="" onSubmit=“serializeGrid()” …>
  2. in serializeGrid() function you call attendant.getCheckedRows(0) if the loadingComplete flag is true
  3. you have a grid with smart rendering enabled and text filters on the cols. OnXLE a global loadingComplete flag will be set to true.
  4. During loading a huge xml file you press “Enter” on a text filter resulting the form being submitted and serializeGrid being executed.

before XLE the serializeGrid should return false to prevent sending the form to the server. after XLE it should send the form.

Result: if you press enter during loading and then perform manually getCheckedRows(0) AFTER the grid is fully loaded the function will always return an empty string

Simplified code:

Tested Browser: Mozilla Firefox 3.6.10 on WinVista Sp1, data has 3450 entries with 7 cols and a total amount of data of 855.3 KB

Would be nice if you can confirm the problem :slight_smile: