Forum
01:34
08/06/2010
Hi,
I've encountered strange behavior of addRowData method. When I add row like:
$("#"+subGridID).addRowData("1", {id:"1",text:"text"});
it throws the following exception:
Uncaught TypeError: Cannot read property 'rownumbers' of undefined
subGridID -> ID of the subgrid 🙂 I create it using the following code:
subGridRowExpanded: function(subgrid_id, row_id) {
var subgrid_table_id;
subgrid_table_id = subgrid_id+"_t";
$("#${searchResultsGridID}").setCell(row_id,'subGridID',subgrid_id);
$("#"+subgrid_id).html('<table id="'+subgrid_table_id+'" class="scroll"></table>');
jQuery("#"+subgrid_table_id).jqGrid({
url:'someurl.html',
datatype: "json",
colModel: [
{name:'parentKeyID', index:'parentKeyID', width:0, align:'center',hidden:true},
{name:'id', index:'id', width:30, align:'center',hidden:true},
{label:'Text', name:'text', index:'text', width:350, align:'center'},
],
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
userdata: "userdata",
id: "id",
cell: "cell"
},
rowNum:20,
sortname: 'id',
sortorder: "asc",
height: '100%',
width: '500',
postData:{resourceKeyID:row_id}
});
},
I would be really appreciated for any kind of help! Thx!
15:11
Moderators
30/10/2007
Hello,
There is a fix regarding addRowdata and rownumbers in the GitHub,
but you have a not needed comma here:
colModel: [
{name:'parentKeyID', index:'parentKeyID', width:0, align:'center',hidden:true},
{name:'id', index:'id', width:30, align:'center',hidden:true},
{label:'Text', name:'text', index:'text', width:350, align:'center'}, <==== Error
],
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.
11:44
Moderators
30/10/2007
Dear usarskyy,
Every piece of code is important.
For me this is not a bug and you problem maybe is that you try to add a data to a grid which does not exists.
Try determine if this
$("#"+subGridID)
is existing element into the dom before to add a data to it.
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.
21:08
Moderators
30/10/2007
Hello,
In order to resolve I need a link to the problem
Thanks
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.
20:15
07/04/2009
I'm having a possibly related problem, using the current version from github. I get "Cannot set property 'name' of undefined" in grid.base.js line 2957.
The problem occurs when I use setCell() within an afterInsertRow handler. Looking at the code in grid.base.js for addRowData(), it seems to be calling the afterInsertRow handler before it actually inserts the data. Shouldn't this line, currently at 2654, be moved down 6 lines to below the lines that insert the data in the local case?
Most Users Ever Online: 715
Currently Online:
51 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