I created a delete button that will delete multiple selected rows in a dataGrid. How to get the cell value from the selected rows. I am trying to get the product_id for the row.
Thanks,
$(function(){
$("#delete").click(function(){
var rows = $('#dataGrid').igGridSelection('selectedRows');
var dataview = $('#dataGrid').data('igGrid').dataSource.dataView();
var cellValue = dataview[rows.index]["IdProduct"];
})
hi,
selectedRows returns an array. Therefore you need to loop through all selected rows in order to get each one's value:
for (i = 0; i < rows.length; i++) {
value = dataview[rows[i].index]["IdProduct"];
}
Hope it helps,
Angel