I have a master grid and want to display the results on row click from master grid in detail grid.. I am not able to fetch the data on my detail grid ....
$(document).ready(function(){
{ $("#navmenu-v li").hover(
function() {
$(this).addClass("iehover"); },
function() {
$(this).removeClass("iehover");
} );
jQuery("#list10").jqGrid({
sortable:true,
url: '/cpsb/json/jsonpageheader.txt',
datatype:'json',
colNames:['Order','Load', 'Gate Time', 'Stop','Customer','Status'],
colModel:[
{
name:'orderNumber',
index:'orderNumber',
width:130,
align:"center",
sorttype:"int"
},
{
name:'loadNumber',
index:'loadNumber',
width:100, align:"center",
sorttype:"int"
},
{
name:'latestTime',
index:'latestTime',
width:160,
align:"center"
},
{
name:'stopSeq',
index:'stopSeq',
width:80,
align:"center",
sorttype:"int"
},
{
name:'customerNumber',
index:'customerNumber',
width:100,align:"center",
sorttype:"int"
},
{
name:'orderStatus',
index:'orderStatus',
width:80, align:"center"
} ],
rowNum:10,
rowList:[10,20,30],
jsonReader : {repeatitems: false,
root: function(obj) {
return obj;
},
page: function (obj) { return 1; },
total: function (obj) { return 1; },
records: function (obj) { return obj.length; }
},
pager: '#pager10',
sortname: 'Gate Time',
sortorder: "desc",
viewrecords: true,
multiselect: true,
caption: "Order Header",
onSelectRow: function(ids) {
if(ids == null) {
ids=0;
if(jQuery("#list10_d").jqGrid('getGridParam','records') >0 )
{
jQuery("#list10_d").jqGrid('setGridParam',{url:"/cpsb/unprocessedOrders.do?method=getUnprocessedOrderDetails"+ids,page:1});
jQuery("#list10_d").jqGrid('setCaption',"Order Header: "+ids).trigger('reloadGrid'); }
}
else {
jQuery("#list10_d").jqGrid('setGridParam',{url:"/cpsb/unprocessedOrders.do?method=getUnprocessedOrderDetails"+ids,page:1});
jQuery("#list10_d").jqGrid('setCaption',"Order Details: "+ids).trigger('reloadGrid');
}
} ,
height:'100%'
});
jQuery("#list10").jqGrid('navGrid','#pager10',{excel:true, add:false,edit:false,del:false,searchtext:"Filter"},{},{},{},{multipleSearch:true});
$("#list10").jqGrid('hideCol', 'cb');
jQuery("#relCasePick").click( function(){
var id = jQuery("#list10").jqGrid('getGridParam','selarrrow');
alert(id);
});
jQuery("#list10_d").jqGrid({
height: 100,
url:'/cpsb/unprocessedOrders.do?method=getUnprocessedOrderDetails',
datatype: "json",
colNames:['Order','SKU', 'UPC', 'Item Description','Quantity Ordered','Teach in Hold?'],
colModel:[ {name:'Order',index:'', width:55},
{name:'SKU',index:'sku', width:55},
{name:'UPC',index:'qty', width:40, align:"right"},
{name:'Item Description',index:'unit', width:150, align:"right"},
{name:'Quantity Ordered',index:'quantity', width:150,align:"right", sortable:false, search:false},
{name:'Teach in Hold?',index:'teachInId', width:150, align:"right"}, ],
rowNum:5,
rowList:[5,10,20],
jsonReader : {repeatitems: false,
root: function(obj) {
return obj;
},
page: function (obj) { return 1; },
total: function (obj) { return 1; },
records: function (obj) { return obj.length; }
},
pager: '#pager10_d',
sortname: 'SKU',
viewrecords: true,
sortorder: "asc",
multiselect: true,
caption:"Order Detail"
}).navGrid('#pager10_d',{add:false,edit:false,del:false}, {},{},{},{multipleSearch:true});
jQuery("#ms1").click( function() {
var s;
s = jQuery("#list10_d").jqGrid('getGridParam','selarrrow');
alert(s); });
}});
is there a way that i will not pull the other grid data and instead of that only on row click from 1st grid i will get the values for next grid