I have a jqgrid and on button click I just want to send two column values instead of sending the whole values...how can I achieve is using getRowData ....any suggestion will be appreciated.. Thanks!
+1
A:
Probably the method getCol can halt you mostly. If one from the columns which you want to send is the column with id
(key:true
) then you can receive data which you need with one call:
var myData = $('#list').jqGrid('getCol', 'column Name 1', true);
If no from the columns has key:true
in the column definition you should make two calls:
var myData1 = $('#list').jqGrid('getCol', 'column Name 1');
var myData2 = $('#list').jqGrid('getCol', 'column Name 2');
Then you can combine the data or set there separate as two parameters:
$.ajax({
type: "POST",
url: "/cpsb/internalOrderList.do",
data : {
jgGridData1: JSON.stringify(myData1),
jgGridData2: JSON.stringify(myData2)
},
dataType:"json",
contentType: "application/json; charset=utf-8",
success: function(response, textStatus, xhr) {
alert("success");
},
error: function(xhr, textStatus, errorThrown) {
alert("error");
}
});
Oleg
2010-09-29 22:08:37
@Oleg thanks! again for your valuable suggestion
paul
2010-09-29 23:00:06