Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Lada Kaiser on Mar 19, 2009 09:37
open dhtmlx forum
Auto resizable grid with paging bar in layout cell

Hello,

I'm using dhtmlXLayoutObject and I want to have a grid component with paging bar as a content of any layout's cell.
That is easy, but how to make grid automaticaly resizable like grid created over cell's method attachGrid();

Exists any solution? Can I found some demo?

thanks for advice,

Lada
Answer posted by Alex (support) on Mar 19, 2009 09:50

Hello, 

In this case the only way is to use attachGrid() and to place paging zone somewhere inside the cell with grid, for example, into the status bar:

var status = dhxLayout.cells("a").attachStatusBar();

status.setText("<div id="pagingArea"></div>");

var grid = dhxLayout.cells("a").attachGrid();

... 

grid.enablePaging(true,10,3,"pagingArea");
 
grid.setPagingSkin("bricks");

Answer posted by block on Aug 01, 2009 05:27
Hi gang.

Almost, it seems to work ok, except you cant read the bar properly.

    //Grid Statusbar
    var gStatus = dhxLayout.cells("b").attachStatusBar();
    gStatus.setText("<div id='pagingArea'></div>");

    //Main Grid
    dhxGrid = dhxLayout.cells("b").attachGrid();
    dhxGrid.setImagePath("./imgs/");
    dhxGrid.setDateFormat("%d %b %Y");
   
    dhxGrid.enablePaging(true,10,3,"pagingArea");
    dhxGrid.setPagingSkin("bricks");
    dhxGrid.init();

The resulting is a little unreadable white line with a few squares in it (well the top halves of them anyway).

I have had a look through the code, and it mentiones adding the css file for it, but i checked and the styles are embedded in the one that has everything so it isnt that.
To check I loaded it up anyway without luck.

Does being in the statusbar upset the styles?

Regards
Answer posted by Alex (support) on Aug 03, 2009 02:01

Hello, 

unfortunately bricks skins weren't desined for using inside status bar. You can use custom paging template (the simples is using default template - just comment //dhxGrid.setPagingSkin("bricks"); to use it): dhtmlxGrid/doc/articles/Custom_paging.html

The height of the status bar can be increased - please, see teh solution in the following post:

http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=8951