PDA

View Full Version : Rows not loading on grid



masudkuet
26 Nov 2006, 10:01 PM
hi,
I am new with yui-ext and having problem with the grid.

I want to change the feed-viewer's createView method with my own method to create a grid instead of view. Here everything works fine and the grid is created but no data is loaded in it. I tested 'dm' with getRowCount() after dm.load(..) and it shows correct number but why the grid is empty?? Am I missing something?? My code is here......




createView : function(el){

var cm = new YAHOO.ext.grid.DefaultColumnModel([
{header: "h1", width: 120},
{header: "h2", width: 180},
{header: "h3", width: 115},
{header: "h4", width: 100},
{header: "h5", width: 50},
{header: "h6", width: 100}
]);

cm.defaultSortable = true;

dm = new YAHOO.ext.grid.XMLDataModel({
tagName: 'item',
totalTag: 'TotalCount',
id: 'id',
fields: ['f1', 'f2', 'f3', 'f4', 'f5', 'f6']
});

//dm.initPaging('f-lists.php', 10);
//dm.setDefaultSort(cm, 5, 'DESC');
dm.on('load', this.onLoad, this, true);

var grid = new YAHOO.ext.grid.Grid(el, dm, cm);
grid.autoWidth = true;
grid.autoHeight = true;
grid.render();
//loadPage(1);
dm.load('f-lists.php');
}

masudkuet
27 Nov 2006, 4:05 AM
after specifying the height of the div element this problem is solved.

But paged grid seems to have problem.

after specifying height ,the grid becomes visible with that height but the paging toolbar of the grid always resides at the bottom of panel which is not expected.

it is not possible to specify height with percent(%) value.

Is it possible to overcome these problems with existing grid element?

Thanks.

jack.slocum
27 Nov 2006, 5:55 AM
You can't use autoWidth and autoHeight in a layout. The layout controls the size of the grid. Use a GridPanel to add the grid to the layout.