Forum
23:17
17/01/2011
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>
17:36
Moderators
30/10/2007
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.
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