Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
addRowData method throws exception
08/06/2010
01:34
Avatar
usarskyy
Member
Members
Forum Posts: 5
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

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 jquery.jqGrid.min.0.0.0.0.js:98

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!

08/06/2010
15:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

08/06/2010
16:14
Avatar
usarskyy
Member
Members
Forum Posts: 5
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

Hi,

thx for reply. Is this fix also included in last 3.7 beta version?

In the original code there're a few more records after comma, but as they are not important I removed them.

09/06/2010
02:44
Avatar
usarskyy
Member
Members
Forum Posts: 5
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

I've just tried on dev version and unfortunately have to say that it doesn't work

09/06/2010
11:44
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

12/06/2010
16:31
Avatar
usarskyy
Member
Members
Forum Posts: 5
Member Since:
08/06/2010
sp_UserOfflineSmall Offline

Hi,

subgrid exists. I've used the following code to check it:

if ($("#" + subGridID).length > 0){

alert('exists');

}

13/06/2010
21:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

29/09/2010
20:15
Avatar
Keith Ivey
Washington, DC, USA
Member
Members
Forum Posts: 9
Member Since:
07/04/2009
sp_UserOfflineSmall Offline

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?  

if(air) { t.p.afterInsertRow.call(t,rowid,data,data); }
06/10/2010
21:49
Avatar
Keith Ivey
Washington, DC, USA
Member
Members
Forum Posts: 9
Member Since:
07/04/2009
sp_UserOfflineSmall Offline

Am I misunderstanding something? Isn't it a bug that the afterInsertRow handler is run before the row data is inserted?

03/02/2011
23:18
Avatar
Keith Ivey
Washington, DC, USA
Member
Members
Forum Posts: 9
Member Since:
07/04/2009
sp_UserOfflineSmall Offline

I'm still having to reapply this patch after every update. Shouldn't the afterInsertRow handler run *after* the row is inserted, not before?

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information