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
Error "Length of colNames colModel!" when adding only one column using jqGridImport
17/01/2011
23:17
Avatar
kellymiller77
New Member
Members
Forum Posts: 1
Member Since:
17/01/2011
sp_UserOfflineSmall Offline

I've discovered a bug when trying to load the grid with the jqGridImport method
when the data only contains one record. The ImpType is xml.

When I debugged the javascript, it was clear that when the xml got converted to json,
the colNames resulted as a string and not an array (when there was only one).

Therefore, later in the code when the colNames.length gets compared to the colModel.length,
the length of colNames was 12 (the length of the string), instead of 1
(the length of the array – had it been converted properly).

So I receive a javascript alert with the message "Length of colNames <> colModel!" and no
data gets loaded into the grid.

As soon as I add another column to the grid, the colNames xml gets converted to an array
correctly and it passes the length check and the grid loads with data.

Is anyone aware of this bug?

Here is a sample of the xml being imported.

<roots>
<grid>
<colModel>
<name>[ColumnName]</name><index>DataField</index><width>0</width><resizable>false</resizable>
</colModel>
<colNames>[ColumnName]</colNames>
<url>/Psr/GetGridContent</url>
<datatype>xml</datatype>
<mtype>POST</mtype>
<loadtext>[loading]</loadtext>
<pgtext>[Page] {0} [of] {1}</pgtext>
<emptyrecords>[NoRecordsToView]</emptyrecords>
<rowNum>0</rowNum>
<autowidth>false</autowidth>
<height>300</height>
<width>800</width>
<shrinkToFit>false</shrinkToFit>
<pager>#gridId_680fcb8c-088f-42fa-869a-d5ef2ca2228b_pager</pager>
</grid>
</roots>
26/01/2011
17:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Interesting. I will check this behaviour.

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:
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