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_TopicIcon
Creating grid in AJAX call
31/05/2010
23:16
Avatar
RobWalker
New Member
Members
Forum Posts: 2
Member Since:
31/05/2010
sp_UserOfflineSmall Offline

I am trying to create a new grid in response to the results from an AJAX call where the column layout of the grid is defined on the fly.

So far I have:

  var grid = $("#results_grid");

  grid.jqGrid({

    datatype: 'local',

    colNames: column_names,

    colModel: column_model,

    caption: "Query results",

    altrows: true,

    viewrecords: true

  });

And then I add the data using:

  grid.jqGrid('addRowData', idx, data);

The problem is that I get an exception in addRowData to the effect that 't.rows.length' is null ... which it is.  After that the grid appears on the page with the columns defined, but no rows visible.

I've tried this in 3.6.4 and the 3.7 beta. Am I missing a step somewhere?

01/06/2010
01:18
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Verify that #results_grid is defined as a <table> element and not as a <div>.

01/06/2010
17:26
Avatar
RobWalker
New Member
Members
Forum Posts: 2
Member Since:
31/05/2010
sp_UserOfflineSmall Offline

OlegK said:Verify that #results_grid is defined as a <table> element and not as a <div>.


Perfect!  It is working great now ... thanks for the help, I was so focused on the javascript I missed the obvious bit!

01/06/2010
18:00
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You welcome!

I month ago I made the same error. I spend a lot of time in searching such error. Thus I could see in your question the solution immediately.  By the way I placed a feature request which could reduce the time of searching of such kind of bugs /blog/?page_id=393/feature-request/more-control-of-requirements-and-generation-alerts/&value=1671&type=9&include=0&search=1&ret=all.

Best regards
Oleg 

02/06/2010
21:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Oleg,

We will try to make such checking.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
61 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