Forum


17:11

03/10/2008

hello…
i'm trying to set up a master-detail-grid. master grid works fine but when i click on a row to populate the detail-grid, nothing happens. well for now details-grid is not even showing on the main page. i put the details-grid code in a separate file to check whether code was working or not and it seems its fine. so it seems that the only time detail-grid code is not working is when i have it togather with the master-grid code on the main page.
below is how i have it set up but only the mater-grid shows the records and detail-grid is not even visible. i have tried every possible option to make it work but no luck so far.
also for now i'm not passing any parameters to master_subgrid.php page as for now i'm only trying to make it visible and work on the main page where master-grid is. sql-query parameter is hard-coded and it does return rows [on the separate page which is tester.html]
<script type=”text/javascript”>
jQuery(document).ready(function(){
jQuery(”#list10″).jqGrid({
url:'master_server.php',
datatype: “json”,
colNames:['OT_ID','OT_UserID', 'OT_OrderID', 'Order-Time','UniQueQuantityOrdered','OrderStatus'],
colModel:[
{name:'OT_ID',index:'OT_ID', width:55},
{name:'OT_UserID',index:'OT_UserID', width:90},
{name:'OT_OrderID',index:'OT_OrderID', width:100 , sortable:true},
{name:'OT_TimeOfOrder',index:'OT_TimeOfOrder', width:80, align:"right"},
{name:'OT_UniqueQuantityOrdered',index:'OT_UniqueQuantityOrdered', width:80, align:"right"},
{name:'OT_OrderStatus',index:'OT_OrderStatus', width:80, align:"right"}
],
pager: jQuery('#pager10'),
rowNum:10,
rowList:[10,20,30],
imgpath: 'themes/sand/images',
sortname: 'OT_ID',
viewrecords: true,
sortorder: “asc”,
width: 1200,
height:400,
multiselect: false,
caption: “Orders Header”,
onSelectRow: function(ids)
{
var ret = jQuery(”#list10″).getRowData(ids);
alert(ret.OT_UserID+”_”+ret.OT_OrderID);
jQuery(”#list10_d”).setGridParam({url:”master_subgrid.php”,page:1})
.setCaption(”Orders Detail: “+ids)
.trigger('reloadGrid');
// commented out for now
/*
if(ids == null)
{
ids=0;
if(jQuery(”#list10_d”).getRecords() >0 )
{
jQuery(”#list10_d”).setGridParam({url:”master_subgrid.php”,page:1})
.setCaption(”Orders Detail: “+ids);
.trigger('reloadGrid');
}
}
else
{
jQuery(”#list10_d”).setGridParam({url:”master_subgrid.php”,page:1})
.setCaption(”Orders Detail: “+ids)
.trigger('reloadGrid');
}*/
}
}).navGrid('#pager10',{add:false,edit:false,del:false});
// sub-grid but this does not work and is not even visible on the page
jQuery(”#list10_d”).jqGrid({
height: 100,
url:'master_subgrid.php',
datatype: “json”,
colNames:['Order-ID','Item-ID','Details [Name_Price_Discount_Final-Price]','Quantity Bought','Sub-Total'],
colModel:[
{name:'Order_ID',index:'Order_ID', width:55},
{name:'Prod_ID',index:'Prod_ID', width:180},
{name:'Prod_Details',index:'Prod_Details', width:80, align:"right"},
{name:'ItemQuantityOrdered',index:'ItemQuantityOrdered', width:80, align:"right"},
{name:'OrderSubTotal',index:'OrderSubTotal', width:80,align:"right", sortable:false, search:false}
],
rowNum:5,
rowList:[5,10,20],
imgpath: 'themes/sand/images',
pager: jQuery('#pager10_d'),
sortname: 'Order_ID',
viewrecords: true,
sortorder: “asc”,
multiselect: true,
caption: “Orders Detail”
}).navGrid('#pager10_d',{add:false,edit:false,del:false});
});
</script>
<table id=”list10″ class=”scroll” cellpadding=”0″ cellspacing=”0″></table>
<div id=”pager10″ class=”scroll” style=”text-align:center;”></div>
<br />
<table id=”list10_d” class=”scroll” cellpadding=”0″ cellspacing=”0″></table>
<div id=”pager10_d” class=”scroll” style=”text-align:center;”></div>
thanx in advance for the help and suggestions.
Most Users Ever Online: 715
Currently Online:
94 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66