javascript - JQGrid grouping while using loadonce issue -


first timer here... in advance.

i have jqgrid page. jqgrid (latest version... downloaded yesterday) setup:

$(function() {     $("#list").jqgrid({         caption: "my first grid",         url: "demo_data.php",         loadonce: true,         datatype: "xml",         mtype: "get",         pager: "#pager",         height: "100%",         autowidth: true,         altrows: false,         rowtotal: 2000,         rownum: 10000,         rowlist: [10, 25, 50],         viewrecords: true,         autoencode: true,         colnames: ["publisher", "first name", "last name", "email"],         colmodel: [             {name: "pid"},             {name: "fname"},             {name: "lname"},             {name: "email", summarytype:'count',summarytpl:'<b>{0} item(s)</b>'}         ],         sortname: "pid",         sortorder: "desc",         grouping: true,          groupingview: {             groupfield: ['pid'],             grouporder: ['asc'],             groupcollapse : true,             grouptext : ['<b>{0} - {1} item(s)</b>'],             groupsummary : true         },         ignorecase: true     });     $("#list").jqgrid('filtertoolbar',{         stringresult: true,         searchonenter : false,         defaultsearch: "cn"     }); }); 

while loadonce true, error on console:

uncaught typeerror: cannot read property '0' of null 

this error stops script on line of code:

if(!grdata[kk - offset]) { break; } 

on grouprender function.

when make loadonce false, works fine grouping loose awesome client side data manipulation.

this xml file i'm sending data:

<rows>   <row id = '1'>     <cell></cell>dataa</cell>     <cell>namea</cell>     <cell>lastnamea</cell>     <cell>email a</cell>   </row>   <row id = '2'>     <cell>dataa</cell>     <cell>nameb</cell>     <cell>lastnameb</cell>     <cell>email b</cell>   </row>   <row id = '1'>     <cell>datab</cell>     <cell>nameaa</cell>     <cell>lastnameaa</cell>     <cell>email aa</cell>   </row>   <row id = '1'>     <cell>datab</cell>     <cell>namebb</cell>     <cell>lastnamebb</cell>     <cell>email bb</cell>   </row> </rows> 

thanks in advance assistance :)

loadonce: true not seem work grouping:true if datatype xml

i had same problem , solved changing php page called url property return json , changed datatype property json.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -