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.
|
1 |
<roots><br /><grid><br /><colmodel><br /><name>[ColumnName]</name><index>DataField</index><width>0</width><resizable>false</resizable><br /></colmodel><br /><colnames>[ColumnName]</colnames><br /><url>/Psr/GetGridContent</url><br /><datatype>xml</datatype><br /><mtype>POST</mtype><br /><loadtext>[loading]</loadtext><br /><pgtext>[Page] {0} [of] {1}</pgtext><br /><emptyrecords>[NoRecordsToView]</emptyrecords><br /><rownum>0</rownum><br /><autowidth>false</autowidth><br /><height>300</height><br /><width>800</width><br /><shrinktofit>false</shrinktofit><br /><pager>#gridId_680fcb8c-088f-42fa-869a-d5ef2ca2228b_pager</pager><br /></grid><br /></roots> |
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top