jQWidgets Forums

jQuery UI Widgets Forums Grid Delete multiple selected rows using checkbox in grid

This topic contains 2 replies, has 3 voices, and was last updated by  shiva kumar 11 years, 3 months ago.

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

  • sreeni379
    Member

    Hi Peter Stoev,

    I need help from you, I have grid ,in that selected multiple rows using Checkbox, selected rows as to delete from grid

     

    Thanks

    Sreeni

     


    Peter Stoev
    Keymaster

    Hi Sreeni,

    To delete multiple selected rows, you can do this:

    // get the indexes of the selected rows.
    var selectedrowindexes = $("#jqxgrid").jqxGrid('getselectedrowindexes');
    var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount;
    // begin update. Stops the Grid's rendering.
    $("#jqxgrid").jqxGrid('beginupdate');
    selectedrowindexes.sort();
    // delete the selected rows by using the 'deleterow' method of jqxGrid.
    for (var m = 0; m < selectedrowindexes.length; m++) {
    var selectedrowindex = selectedrowindexes[selectedrowindexes.length - m - 1];
    if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
    var id = $("#jqxgrid").jqxGrid('getrowid', selectedrowindex);
    $("#jqxgrid").jqxGrid('deleterow', id);
    }
    }
    // end update. Resume the Grid's rendering.
    $("#jqxgrid").jqxGrid('endupdate');

    Hope this helps.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    shiva kumar
    Participant

    Hi Peter,

    First of all , i would like to thank you for your tremendous support here in this forum

    My Question :
    i have a grid with multiple rows with a column of checkbox.
    A button should be available at the end of the grid and onClick of that button, selected checkbox rows should be deleted
    Can you please provide the complete code

    Regards,
    Shiva Kumar

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

You must be logged in to reply to this topic.