jqGrid local date manipulation; problem with row ids when deleting and adding new rows

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-04-27T09:37:23Z Indexed on 2010/04/27 9:43 UTC
Read the original article Hit count: 321

Filed under:
|
|

I'm using jqGrid as a client side grid input, allowing the user to input multiple records before POSTing all the data back at once.

I'm having a problem where if the user has added a few records (say 3 ) the id's for the records will be 1,2,3. if the user deletes record 2, you're left with 1 and 3 for the id of the records.

When the user now adds a new records, jqGrid assigns that records the id 3 again since it just seems to count the total records and increments it by one for the new record. This causes problems when selecting rows as now the row id's are 1, 3 and 3.

Does anyone know how to access the row ids of records as I could probably use the afterSubmit event and reassign the row id's increasing from 1. ( so after i delete row id 2, this will set the other row id's to 1 and 2)

Any other suggestions to solve this problem?

Thanks

© Stack Overflow or respective owner

Related posts about jqgrid

Related posts about JavaScript