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
270
Getting cell value from multiple selected rows
posted

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"]; 

     })

})

Parents
No Data
Reply
  • 24671
    Verified Answer
    posted

    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

Children
No Data