Forum



00:21

05/05/2010

Hello,
We have a weird thing affecting the Expandos property of the grid.
We have our jqGrid working fine with its data loading and server side paging of the data.
But after we show-up the modal pop-up (the one built-in the jqGrid), so after a post of the data to a service (url) or after
a cancel of the window, the reloadAfterSubmit does not seem to fire. But worse, when we try to do paging on the grid,
the code we have in the datatype property fires and when we do this: var thegrid = jQuery("table[id*=TestGrid]")[0];
then the grid has nothing in the Expandos property, it only contains : cellpading.
But it we do this (after showing up the modal window, in the datatype property):
var thegrid = jQuery("table[id*=TestGrid]")[2];
.... then I see all the functions usually found in the Expandos property of the grid. BUT WHY do I need to do [2] on the selector ???
I am new to jqGrid, maybe I'm missing something. Please advise. Thanks!!
PS: I'm using IE 8 and the latest version of jqGrid (3.6.5).
Eric
00:28

05/05/2010

Hello again,
I forgot to mention, that if we DO NOT show the modal edit window of the grid, then our code in the datatype property "sees" the Expandos property correctly, this way : var thegrid = jQuery("table[id*=TestGrid]")[0]; and not having to do this:
var thegrid = jQuery("table[id*=TestGrid]")[2]; //?????
Here is the essential code in the datatype property:
$.ajax({
dataType:
url: query,
success:
"json",function (data, textStatus, xhr) {//pageIndex = xhr.getResponseHeader('CurrentPageIndex');
loadPortfoliosComplete(data);
},
error:
alert(errorThrown +
}
});
function (xhr, status, errorThrown) {'\n' + status + '\n' + xhr.statusText);
$.ajax({
dataType:
"json",
url: query,
success:
function (data, textStatus, xhr) {
//pageIndex = xhr.getResponseHeader('CurrentPageIndex');
//pageSize = xhr.getResponseHeader('CurrentPageSize');
loadPortfoliosComplete(data);
},
error:
function (xhr, status, errorThrown) {
alert(errorThrown +
'\n' + status + '\n' + xhr.statusText);
}
});
14:40

Moderators
30/10/2007

Hello,
Do it like this
jQuery("table#TestGrid]")[0],
or simple
jQuery("#TestGrid]")[0],
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:50

05/05/2010

tony said:
Hello,
Do it like this
jQuery("table#TestGrid]")[0],
or simple
jQuery("#TestGrid]")[0],
Regards
Tony
Hi Tony,
In the context of trying to access the grid, in the datatype property,
after doing a show of the modal pop-up to edit a row of the grid:
I've tried what you suggested, with the jQuery("table#TestGrid]")[0].
Unfortunately that gives me "Object doesn't support this property or method".
But if I use this way : jQuery("table[id*=TestGrid]")[0] then
that gives me the grid Object with certain methods but not the addJSONData() method
I'm looking for. That method is "usually" found in the Expandos property of the grid,
at least in IE 8. The Expandos property is there, but with only the cellpading
property. From what I've seen, it should contain many methods, like addJSONData.
Also interestingly, when I do this : jQuery("table[id*=TestGrid]")[1],
then I also get a grid object, but with NO Expandos property at all.
Also, when I do this : jQuery("table[id*=TestGrid]")[2], then I
get the Expandos property with the following stuff:
p
jQuery1273588140348
updateColumns
formatCol
sortData
updatepager
formatter
grid (object)
addXmlData
addJSONData
So to recapitulate, if I don't DO a show of the modal pop-up,
the following jQuery("table[id*=TestGrid]")[0] will give me
exactly what jQuery("table[id*=TestGrid]")[2] gives me if I DO
a show of the modal pop-up. So if I don't show up the modal
edit view in the pop-up, the following will always work:
jQuery("table[id*=TestGrid]")[0].
But if I show up the modal pop-up, then I need to do this:
jQuery("table[id*=TestGrid]")[2]
I suppose this is not normal, not sure.
Thanks for your help on this,
Eric
Most Users Ever Online: 715
Currently Online:
45 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