Forum
06:07
13/02/2010
I've just updated to 3.6 (thanks for continuing to support this great java script grid).
I can't seem to get the edit grid for inline row editing working. Ideas please.
onSelectRow:
function(subGridRowId)
jQuery(document).ready(
function() {
//uses var lastsel as defined probably in WorkItemMain.ascx
var currWorkDate = $.datepicker.formatDate('mm/dd/yy', $("#WorkDate").datepicker("getDate"));
jQuery(gridID).jqGrid({
url: gridReadURL + '?WorkDate=' + currWorkDate,
datatype: "xml",
colNames: ['Id', 'Project', 'Path', 'Task', 'Equipment'],
colModel: [
{ name: 'Id', width: 1, hidden: true, key: true, editable: false },
{ name: 'Project', width: 120, editable: false, align: 'right' },
{ name: 'Path', width: 220, editable: false, align: 'right' },
{ name: 'Task', width: 200, editable: false, align: 'right' },
{ name: 'Equipment', width: 200, editable: true, edittype: "textarea", align: 'right' },
],
rownumbers: true,
rowNum: 60,
sortname: 'Id',
viewrecords: true,
height: 500,
multiselect: false,
subGrid: true,
onSelectRow: function(id) {
//alert("id : " + id);
},
caption: "Equipment Work Item",
subGridRowExpanded: function(subgrid_id, row_id) {
var subGridEquipName = getEquipmentNameForSubGrid(row_id);
var subGridProjStructId = getProjStructIdForSubGrid(row_id);
var subgrid_table_id = subgrid_id + "_t";
jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table>");
jQuery("#" + subgrid_table_id).jqGrid({
url: gridReadRatesURL + '?WorkDate=' + currWorkDate + '&EquipmentId=' + subGridEquipId + '&ProjId=' + subGridProjId + '&ProjStructId=' + subGridProjStructId,
datatype: "xml",
colNames: ['subId', 'ProjectStructureId', 'RateId', 'Rate' ],
colModel: [
{ name: 'subId', width: 1, hidden: true, key: true, editable: false },
{ name: 'ProjectId', width: 1, hidden: true, editable: false },
{ name: 'RateId', width: 50, hidden: true, editable: false, align: 'right' },
{ name: 'Rate', width: 50, editable: false, align: 'right' },
],
rownumbers: true,
rowNum: 10,
sortname: 'subId',
sortorder: "asc",
caption: "Rates for : " + subGridEquipName,
multiselect: false,
height: '100%',
onSelectRow: function(subGridRowId) {
try {
alert("jqGrid id : " + "#" + subgrid_table_id);
alert(" subGridRowId : " + subGridRowId ); // <------------- THIS IS ALWAYS = 0 🙁
} catch (e) {
alert(e.name + " message " + e.message);
}
}
}); //end of the sub grid definition
},
subGridRowColapsed: function(subgrid_id, row_id) {
},
onCellSelect: function(id) {
return;
},
editurl: gridWriteURL,
caption: 'Equipment Work Ticket'
});
});
onSelectRow:
function(subGridRowId) <--------- subGridRowId is always = 0
I've cut and paste the entire grid and subgrid below:
jQuery(document).ready(
function() {
//uses var lastsel as defined probably in WorkItemMain.ascx
var currWorkDate = $.datepicker.formatDate('mm/dd/yy', $("#WorkDate").datepicker("getDate"));
jQuery(gridID).jqGrid({
url: gridReadURL + '?WorkDate=' + currWorkDate,
datatype: "xml",
colNames: ['Id', 'Project', 'Path', 'Task', 'Equipment'],
colModel: [
{ name: 'Id', width: 1, hidden: true, key: true, editable: false },
{ name: 'Project', width: 120, editable: false, align: 'right' },
{ name: 'Path', width: 220, editable: false, align: 'right' },
{ name: 'Task', width: 200, editable: false, align: 'right' },
{ name: 'Equipment', width: 200, editable: true, edittype: "textarea", align: 'right' },
],
rownumbers: true,
rowNum: 60,
sortname: 'Id',
viewrecords: true,
height: 500,
multiselect: false,
subGrid: true,
onSelectRow: function(id) {
//alert("id : " + id);
},
caption: "Equipment Work Item",
subGridRowExpanded: function(subgrid_id, row_id) {
var subGridEquipName = getEquipmentNameForSubGrid(row_id);
var subGridProjStructId = getProjStructIdForSubGrid(row_id);
var subgrid_table_id = subgrid_id + "_t";
jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table>");
jQuery("#" + subgrid_table_id).jqGrid({
url: gridReadRatesURL + '?WorkDate=' + currWorkDate + '&EquipmentId=' + subGridEquipId + '&ProjId=' + subGridProjId + '&ProjStructId=' + subGridProjStructId,
datatype: "xml",
colNames: ['subId', 'ProjectStructureId', 'RateId', 'Rate' ],
colModel: [
{ name: 'subId', width: 1, hidden: true, key: true, editable: false },
{ name: 'ProjectId', width: 1, hidden: true, editable: false },
{ name: 'RateId', width: 50, hidden: true, editable: false, align: 'right' },
{ name: 'Rate', width: 50, editable: false, align: 'right' },
],
rownumbers: true,
rowNum: 10,
sortname: 'subId',
sortorder: "asc",
caption: "Rates for : " + subGridEquipName,
multiselect: false,
height: '100%',
onSelectRow: function(subGridRowId) {
try {
alert("jqGrid id : " + "#" + subgrid_table_id);
alert(" subGridRowId : " + subGridRowId ); // <------------- THIS IS ALWAYS = 0 🙁
} catch (e) {
alert(e.name + " message " + e.message);
}
}
}); //end of the sub grid definition
},
subGridRowColapsed: function(subgrid_id, row_id) {
},
onCellSelect: function(id) {
return;
},
editurl: gridWriteURL,
caption: 'Equipment Work Ticket'
});
});
06:09
13/02/2010
hmmmm my cut and paste got a bit messed up. The grid is pasted twice....here's the full message as it should have been:
I've just updated to 3.6 (thanks for continuing to support this great java script grid).
I can't seem to get the edit grid for inline row editing working. Ideas please.
onSelectRow:
function(subGridRowId) <——— subGridRowId is always = 0
----------------------------------------------------------------------------------------------------------------------
I've cut and paste the entire grid and subgrid below:
---------------------------------------------------------------------------------------------------------------------
jQuery(document).ready(
function() {
//uses var lastsel as defined probably in WorkItemMain.ascx
var currWorkDate = $.datepicker.formatDate('mm/dd/yy', $("#WorkDate").datepicker("getDate"));
jQuery(gridID).jqGrid({
url: gridReadURL + '?WorkDate=' + currWorkDate,
datatype: "xml",
colNames: ['Id', 'Project', 'Path', 'Task', 'Equipment'],
colModel: [
{ name: 'Id', width: 1, hidden: true, key: true, editable: false },
{ name: 'Project', width: 120, editable: false, align: 'right' },
{ name: 'Path', width: 220, editable: false, align: 'right' },
{ name: 'Task', width: 200, editable: false, align: 'right' },
{ name: 'Equipment', width: 200, editable: true, edittype: "textarea", align: 'right' },
],
rownumbers: true,
rowNum: 60,
sortname: 'Id',
viewrecords: true,
height: 500,
multiselect: false,
subGrid: true,
onSelectRow: function(id) {
//alert("id : " + id);
},
caption: "Equipment Work Item",
subGridRowExpanded: function(subgrid_id, row_id) {
var subGridEquipName = getEquipmentNameForSubGrid(row_id);
var subGridProjStructId = getProjStructIdForSubGrid(row_id);
var subgrid_table_id = subgrid_id + "_t";
jQuery("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table>");
jQuery("#" + subgrid_table_id).jqGrid({
url: gridReadRatesURL + '?WorkDate=' + currWorkDate + '&EquipmentId=' + subGridEquipId + '&ProjId=' + subGridProjId + '&ProjStructId=' + subGridProjStructId,
datatype: "xml",
colNames: ['subId', 'ProjectStructureId', 'RateId', 'Rate' ],
colModel: [
{ name: 'subId', width: 1, hidden: true, key: true, editable: false },
{ name: 'ProjectId', width: 1, hidden: true, editable: false },
{ name: 'RateId', width: 50, hidden: true, editable: false, align: 'right' },
{ name: 'Rate', width: 50, editable: false, align: 'right' },
],
rownumbers: true,
rowNum: 10,
sortname: 'subId',
sortorder: "asc",
caption: "Rates for : " + subGridEquipName,
multiselect: false,
height: '100%',
onSelectRow: function(subGridRowId) {
try {
alert("jqGrid id : " + "#" + subgrid_table_id);
alert(" subGridRowId : " + subGridRowId ); // <————- THIS IS ALWAYS = 0
} catch (e) {
alert(e.name + " message " + e.message);
}
}
}); //end of the sub grid definition
},
subGridRowColapsed: function(subgrid_id, row_id) {
},
onCellSelect: function(id) {
return;
},
editurl: gridWriteURL,
caption: 'Equipment Work Ticket'
});
});
21:13
13/02/2010
I just updated to 3.6.4. The problem is still there. The id of the sub grid row is always zero.
I can't see anything obvious that I'm doing wrong. The sub grid displays properly, you can collapse and expand it. But when you select a subgridrow and check the id the id of the sub grid row remains zero.
Most Users Ever Online: 715
Currently Online:
48 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