Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Vikram on Jan 21, 2009 02:27
open dhtmlx forum
Grid Pagination for Div Tags

Hi,

I am trying to implement pagination for a grid within tabs displayed within a dhtmlxWindow.Below is the snippet of code used.

var pos_orders_grid= new dhtmlXGridObject("tab_posOrder_contents");
pos_orders_grid.setHeader(".......,....,....,....,.....,...,...,....") ;
pos_orders_grid.attachHeader("#text_filter,#text_filter,,,,#text_filter,,,#text_filter");
pos_orders_grid.setInitWidths("100,125,100,100,100,100,100,100,*");
pos_orders_grid.setColAlign("left,left,left,left,left,left,left,left,left");
pos_orders_grid.setColTypes("link,link,link,link,link,link,link,link,link");

pos_orders_grid.enablePaging(true,5,3,"tab_posOrder_contents",true,"pageArea");

pos_orders_grid.setPagingSkin("bricks");
pos_orders_grid.setSkin("light");    
pos_orders_grid.init();
pos_orders_grid.loadXMLString(loader.xmlDoc.responseText);    

and the corresponding Jsp

<div id="tab_posOrder_contents" style="width:auto;height:300px;display:none;"></div>
<div id="pageArea"></div>

The above piece of code doesn't seem to show the pagination control.. below the grid.Wanted to know if I am doing anything wrong in placing the div's or using the enablePaging syntax
Answer posted by Support on Jan 21, 2009 04:00
The code must look as 
pos_orders_grid.enablePaging(true,5,3,"pageArea",true); 

You need to specify a separate DIV container as parameter of enablePaging command , not the same container which already used by grid. 
( in case of "bricks" skin, the second container is not necessary, so we can skip last parameter )