Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by josh on Oct 22, 2008 08:36
open dhtmlx forum
attachGrid() with paging bar?

attachGrid() with paging bar?

can we attach a grid with the paging bar? for example the 'toolbar' paging skin
any simple way to do this?

i tried the following:
-----
var gridBox = document.createElement("DIV");
    gridBox.setAttribute('id','gridComponentBox');
    var _gridbox = document.createElement("DIV");
    _gridbox.id = "gridBox";
    var _pagingbox = document.createElement("DIV");
    _pagingbox.id = "pagingBox";
    _pagingbox.align = "center";
    
    gridBox.appendChild(_gridbox);
    gridBox.appendChild(_pagingbox);
    document.body.appendChild(gridBox);
    
    this.dhxGrid = new dhtmlXGridObject("gridBox");*/
    this.dhxGrid = layoutObj.attachGrid();
    this.dhxGrid.setImagePath(that._imagePath);
this.dhxGrid.enablePaging(true,10,3,'pagingBox',true);
this.dhxGrid.setPagingSkin("toolbar");
    this.dhxGrid.loadXML(url);

    layoutObj.attachObject(gridBox);
-----

But the above code doesnot work, i can't seem to have both the pagingbar and the grid to display at the same time. And also, the grid is not skinned at all....

Any other ways?


Thanks,
Answer posted by Support on Oct 22, 2008 09:35
You can put the predefined HTML object in laout , which will have zones for grid and paging , and create the grid in necessary  area 
  layoutObj.attachObject("gridBox");//added
  this.dhxGrid = new dhtmlXGridObject("gridBox");*/ 
//  this.dhxGrid = layoutObj.attachGrid();  //commented
  this.dhxGrid.setImagePath(that._imagePath); 
  this.dhxGrid.enablePaging(true,10,3,'pagingBox',true); 
  this.dhxGrid.setPagingSkin("toolbar"); 
  this.dhxGrid.loadXML(url);

but in such case you will lost native auto-size functionality ( grid will not be linked to layot )

Answer posted by Toon on Oct 22, 2008 15:25
Hello Josh.

Had the same problem with accordion.
My solution is in attached zip.
Attachments (1)