0

I would like to loop through a jqGrid so that I can get the value of cell for futher logical processing.

var ids = $("#list").getGridParam("reccount")
alert(ids);
var v = 1;
 for(var i = 0; i < ids ; i++){
    amountvalue = $("#list").getCell(v,"amount");           
    alert(amountvalue);
    v = v + 1;
}

Strangely as obvious as it seems I am not getting the values as expected. What am I missing?

davykiash
  • 1,796
  • 5
  • 27
  • 60

1 Answers1

0

if you want the values of all column cells value try this code

$("#list").getCol('amount');

or

var amountvalue = new Array(ids.length);

var ids = $("#list").getGridParam("reccount")

 for(var i = 0; i < ids ; i++){
    amountvalue[i] = $("#list").getCell(i,"amount");           
    alert(amountvalue[i]);

}

and if you want to get a value of specific cell then use this

var amountvalue = $("#list").getCell(5,"amount"); 
aamir sajjad
  • 3,019
  • 1
  • 27
  • 26