jQuery UI Widgets Forums Grid How to avoid adding duplicate row in jqqrid

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • ganamg
    Participant

    Hi,

    I don’t want to add same row again for jqgrid if the same row is already added/exist in grid.

    Example: I have added 2-3 rows to grid by clicking on Add new row button. I don’t want to allow again adding new row, If there is same data/row exist in the grid.

    How can i achieve this?


    Dimitar
    Participant

    Hello ganamg,

    There is no direct way to prevent this but here is our suggestion: get all rows with the method getrows; iterate through the rows array and compare each row to the one you would like to add; if the two rows are the same (their corresponding cells have the same values), do not add the row. This would be made less complicated if each of your rows has an unique field (like id).

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.