Forum
00:49
30/04/2010
In the past, I've been able to successfully implement autoloading tree nodes. Today, when I attempt to implement another tree grid with autoloading, the expanding of a selected row does not work. I copied much of my existing (good) code to this new implementation.
Specifically, the root nodes load successfully. But when I click on a '+' the image toggles to a '-' but no ajax call is made to the server to retrieve child nodes. Very strange...as this code was working perfectly in previous implementation. Any thoughts as to what would prevent jqGrid from issuing child node ajax calls? Below is my config:
$('#table-contracts-new-draft').jqGrid({
treeGrid: true,
treeGridModel: 'adjacency',
ExpandColumn : 'name',
url: '/contracts/asynccustomer/contracts' + contractsRequestParams(),
datatype: "json",
jsonReader : {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: true,
cell: "cell",
id: "id",
userdata: "userdata"
},
mtype: "GET",
colNames:['Project Name', 'Sales Rep', 'Start Date', 'End Date', 'System Notes'],
colModel: [
{
name: 'name',
index: 'name',
width: 400,
hidden: false,
sortable: false
},
{
name: 'rep',
index: 'rep',
width: 200,
hidden: false,
sortable: false
},
{
name: 'startdt',
index: 'startdt',
width: 130,
hidden: false,
sortable: false
},
{
name: 'enddt',
index: 'enddt',
width: 130,
hidden: false,
sortable: false
},
{
name: 'notes',
index: 'sysnotes',
width: 400,
hidden: false,
sortable: false
}
],
height: 'auto',
width: 'auto',
pager: false,
viewrecords: true,
sortorder: "desc",
loadError : function(xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
if (xhr.responseText.length > 0) {
$('#contracts-new-draft').replaceWith('<b>'+xhr.responseText+'</b>');
}
}
});
14:15
Moderators
30/10/2007
Hello,
Could you please post your initial server response when the grid load data?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
17:17
30/04/2010
Here is the initial server response:
{"page":1,"total":1,"rows":[{"id":"e11d23a489cd4250a84ae0461ac0a480","cell":["First contract","AndyBrolan","2010-04-24","2011-04-24","Version bump. Customer modified\/updated.",0,null,"false","false"]},{"id":"059c8db68dc5413ab6d84817ecb61b9b","cell":["Second contract","Andy Brolan","2010-04-24","2012-04-24","Version bump. Customer modified\/updated.",0,null,"false","false"]},{"id":"a7d26c163f9543b89304b6eb8da5b762","cell":["Third Contract","Andy Brolan","2010-04-23","2013-03-23","Version bump. Customer modified\/updated.",0,null,"false","false"]},{"id":"777f97f4f1c443cd804037179b34efd5","cell":["Fifth contract","Andy Brolan","2010-05-25","2015-05-25","Version bump. Customer modified\/updated.",0,null,"false","false"]}],"records":4}
19:49
Moderators
30/10/2007
Hello,
Will try to test it as soon as possible. Also I will test it with the last release.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
07:17
07/07/2010
I think I'm having the same problem
Since upgrading from version 3.6.4 to 3.7.2 loading at once on tree grids do not seem to be working correctly.
The data loads into the grid correctly by when I click on a row to expand it out nothing happens.
If I set the rows to be expanded, they show expanded with the correct sub rows showing but clicking on the top level row does not collapse it.
It looks like it maybe something to do with the event that is fired when expanding the row. As far as I can tell the event is being triggered and run but it has no effect on the grid
Rolling back to the previous version of jqGrid solves the problem.
I have tried with both JSON and XML with no success.
If I load the sub rows on demand it seems to work correctly, but this is not what I want. I want to be able to load all rows and sub rows at once.
I would really like to be able to use the latest version as it has some bug fixes that I require.
Cheers
Rowan
08:08
07/07/2010
Never mind.
It turns out that I had a period in my rowid (eg "7.1").
Turns out that jQuery needs special characters in the ID selector to be escaped
"If the id contains characters like periods or colons you have to escape those characters with backslashes." (http://api.jquery.com/id-selector/)
Seems there was a change the way the row was being selected which caused this to not with with ID with special characters.
I just chaged the ID to not use periods anymore
Rowan
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