jQWidgets Forums

jQuery UI Widgets Forums Grid Adding a new row as first row to the grid

This topic contains 2 replies, has 2 voices, and was last updated by  omer 11 years, 5 months ago.

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

  • omer
    Participant

    Hi Everyone,

    I am able to add a row to the jqxgrid using $(“#jqxgrid”).jqxGrid(‘addrow’, 1 , row); It always adds the row to the end of the grid, I want the added row to appear as first row and existing rows should move down..

    Is there a way that this can be achieved. I cannot refresh the grid because the data is temporary after populating all the rows it saves to the database.

    Adding a new row as first row to the grid #48033

    hrc
    Participant

    Hi Omer,

    use $(“#jqxgrid”).jqxGrid(‘addrow’, 1 , row, ‘first’)

    The last parameter of the addrow method is optional. You can use values like: “first” and “last”(default value). If you pass “first”, the new row will be added as a first row.

    Regards,

    D.

    Adding a new row as first row to the grid #48051

    omer
    Participant

    Thanks a lot, It works , I was using a long procedure ,

    copy all the rows in the grid
    delete all the rows in the grid or clear the grid
    insert a new row which will be the first row
    insert back the rows which were copied in the rows variable.

    I commented them out and replaced it with a single line from you.

    Regards
    Omer

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

You must be logged in to reply to this topic.