:: Forum >> Version 2 >>

I want to Display only 6 records from the XML file I am reading from, but the code load all the records to the grid

var table = new AW.XML.Table;
table.setURL("data/companies-simple.xml");
table.request();
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
var obj = new AW.UI.Grid;

obj.setColumnCount(6);
obj.setHeaderText(columns);
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
obj.setCellFormat([str, str, num, num, num]);
obj.setSelectorVisible(true);
obj.setSelectorWidth(25);
obj.setSelectionMode("single-row");
obj.setCellModel(table);
obj.setVirtualMode(true);

obj.setRowCount(6);
obj.setRowIndices( [0,1,2,3,4,5] );
obj.refresh();
document.write(obj);

rahul
Tuesday, March 14, 2006
You can override row count in the table object -

var table = new AW.XML.Table;
table.getCount = function(){return 6}

Alex (ActiveWidgets)
Tuesday, March 14, 2006



This topic is archived.

Back to support forum

Forum search