Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
885
deleting multiple rows in client side?
posted

Hi,

       I am using WebDataGrid (vol 12.1) in my project. I basically list the files present in a folder inside the grid. I also have an option to delete single / multiple file(s). When i select and delete a file, i am just hiding that row. All of this is done in client-side. I have enabled Batch Updates

<Behaviors>
<ig:EditingCore AutoCRUD="False" BatchUpdating="True"></ig:EditingCore>
<ig:Selection CellClickAction="Row" RowSelectType="Multiple"></ig:Selection>
</Behaviors>

   I am not able to delete multiple rows at a single go. For example, in the grid i have 7 rows, and i select 3 rows to be deleted and i click on "Del" button. Instead of deleting 3 rows, it is deleting only 1 single row. The code i have written in client-side for "Del" button is shown below

var grid = $find("WebDataGrid1");
var selectedRows = grid.get_behaviors().get_selection().get_selectedRows();

for (var j=0; j< selectedRows.get_length();j++)
{
       grid.get_rows().remove(selectedRows.getItem(j), false);
}

       After clicking on the "Del" button, i am able to get the count as 3. After removing the first row, the selectedRows.get_length() becomes 0. What could be the  problem? Can we delete multiple rows in the grid in client-side? If so How? I am converting my UltraWebGrid to WebDataGrid.

Thanks,
Raja.