Forum


07:21

11/05/2009

Hi all,
i have to use a cliendSide Array or XML-String to fill the grid.
my code:
<table id="list" class="scroll"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>
<script type="text/javascript">
var mystr ="<?xml version='1.0' encoding='utf-8'?><invoices><rows>"
+"<row>"
+"<cell>data1</cell>"
+"</row>"
+"<row>"
+"<cell>data2</cell>"
+"</row>"
+"<row>"
+"<cell>data3</cell>"
+"</row>"
+"<row>"
+"<cell>data4</cell>"
+"</row>"
+"<row>"
+"<cell>data5</cell>"
+"</row>"
+"<row>"
+"<cell>data6</cell>"
+"</row>"
+"<row>"
+"<cell>data7</cell>"
+"</row>"
+"<row>"
+"<cell>data8</cell>"
+"</row>"
+"<row>"
+"<cell>data9</cell>"
+"</row>"
+"<row>"
+"<cell>data10</cell>"
+"</row>"
+"<row>"
+"<cell>data11</cell>"
+"</row>"
+"</rows>"
+"</invoices>";
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
datatype: 'xmlstring',
datastr : mystr,
width:300,
colNames:['Inv No'],
colModel :[
{name:'invid', index:'invid', width:55, sorttype:'int'} ],
pager: jQuery('#pager'),
rowNum:10,
rowList:[10,20,30],
viewrecords: true,
imgpath: gridimgpath,
caption: 'My first grid'
});
});
</script>
At the image you can see my problem. I have 11 records in my grid, the "rowNum" == "10" and everything is on one page. can you give me a solution how i can work with the pager and a "clientSide" datastore.
greets
arne
02:28

Moderators
30/10/2007

Hello,
Humm, you are right. The problem is that grid expect 10 (or less than 10) rows from server. When we deal with xml,json and strings this is not checked. I need to revise this and check the code. Should apply the fix carefully.
Thanks
Best 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:
64 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