Forum


07:58

05/02/2009

I have been trying to get a grid as a subgrid to work for about a week now. When I click the plus sign in a row, I can see (via firebug) that the code relative to the subgrid gets run, but the server program doesn't. It's like it never calls the server-side program. If someone could take a look at my code to see what's wrong with it, I would appreciate it.
$(document).ready(function()
{
var columnNames = ['Warehouse','Quantity','Value'];
var columnModel = [
{name:'id', resizable:false, index:'id', width:50, align:'center', sortable:false},
{name:'quantity', resizable:false, index:'quantity', width:90, align:'center', sortable:false},
{name:'value', resizable:false, index:'value', align:'center', width:55, sortable:false}];
var gridwidth = $('.tableContainer').width();
gridwidth = gridwidth-40;
$("#results").jqGrid(
{
url: "RINVINQ2",
datatype: "json",
mtype: 'GET',
colNames: columnNames,
colModel: columnModel,
//pager: jQuery('#pager2'),
rowNum: 50,
rowList: [10,20,50,100],
imgpath: "../javascript/JQGrid/themes/sand/images",
viewrecords: true,
caption: "Inventory Status By Division",
width: gridwidth,
height: '300px',
subGrid: true,
subGridRowExpanded: function(subgrid_id, row_id)
{
var subgrid_table_id;
subgrid_table_id = subgrid_id+"_t";
jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>");
jQuery("#"+subgrid_table_id).jqGrid(
{
url:"RINVINQ3?id="+row_id,
datatype: "json",
//mtype: GET,
colNames: ['Customer','Quantity','Amount','Last Release Date'],
colModel:
[
{name:"customer",index:"customer",width:80,key:true},
{name:"quantity",index:"quantity",width:130},
{name:"amount",index:"amount",width:80,align:"right"},
{name:"lastReleaseDate",index:"lastReleaseDate",width:80,align:"right"}
],
height: 100,
width: gridwidth,
rowNum: 20,
imgpath: "../javascript/JQGrid/themes/sand/images",
});
},
loadComplete: function()
{
$('#cb').prev().remove();
if($("#results").getGridParam("records")==0)
{
$('#noResults').dialog("open");
}
else
{
var page = $('#results').getGridParam("page");
var records = $('#results').getGridParam("records");
var recordsPP = $('#results').getGridParam("rowNum");
var x = records/recordsPP;
var returnArray = [];
if(x < page)
{
iterLimit = records%recordsPP;
}
else
{
iterLimit = recordsPP;
}
for(var i=1; i<=iterLimit; i++)
{
$('#'+i).children('td:first').next().addClass('link').css("cursor","pointer").css("color","blue").css("text-decoration","underline");
var ord = $('#'+i).children('td:first').next().text();
$('#'+i).children('td:first').next().click(function()
{
ord = $(this).text();
window.location.href = "inv0004?productGroup="+ord;
});
//returnArray = orderList.find(ord);
var truefalse = typeof returnArray;
if(truefalse != 'boolean')
{
$('#results').setSelection(i);
}
}
}
},
shrinkToFit: true,
jsonReader :
{
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems : false,
subgrid: { root:"rows", repeatitems: true, cell:"cell" }
}
});
});
Most Users Ever Online: 715
Currently Online:
47 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