jQWidgets Forums

jQuery UI Widgets Forums Grid jqxGrid Context event

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • jqxGrid Context event #49498

    anshu
    Participant

    Hi ,

    We have created a context event to delete the row of the grid . It works fine first time but after that it breaks .
    Below is the code .

    // deleteGridRow will delete the row from grid and corresponding viewModel
    deleteGridRow :function(view, gridId, viewModel){
    view.isDirty = true;

    var currentGrid = view.$rootDiv.find(gridId);
    var rowIndex = currentGrid.jqxGrid(‘getselectedrowindex’);
    var rowdetails = currentGrid.jqxGrid(‘getrowdata’, rowIndex);
    viewModel.deleteRow( rowdetails.rowUniqueId);
    var rowid = currentGrid.jqxGrid(‘getrowid’, rowIndex);
    currentGrid.jqxGrid(‘deleterow’, rowid);
    },

    In the above code , row Index become null , unexpectedly when we attempt to delete a row second time .It is not able to pick the row Index .

    jqxGrid Context event #49500

    Peter Stoev
    Keymaster

    Hi anshu,

    It is possible that “getselectedrowindex” returns -1 if the selected row is deleted and you try to get it.

    Best Regards,
    Peter Stoev

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

    jqxGrid Context event #49501

    anshu
    Participant

    In the grid if there is a row and I delete it , it works fine .But after that if I add another one and try to delete that, it goes wrong . On debugging I see ,it shows jqxGrid as undefined in the code .

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

You must be logged in to reply to this topic.