var myGrid;
function GridboxInit() {
myGrid = new dhtmlXGridObject('gridbox');
myGrid.setImagePath("codebase/imgs/");
myGrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
myGrid.setInitWidths("80,150,100,80,80,80,80,100");
myGrid.setColAlign("right,left,left,right,center,left,center,center");
myGrid.setColTypes("dyn,ed,txt,price,ch,coro,ra,ro");
myGrid.setColSorting("int,str,str,int,str,str,str,date");
//set values for select box in 5th column
var combobox = myGrid.getCombo(5);
combobox.put("1","1 Hour");
combobox.put("12","12 Hours");
combobox.put("24","24 Hours");
combobox.put("48","2 days");
combobox.put("168","1 week");
combobox.put("pick","pick up");
combobox.put("na","na");
myGrid.enableAutoWidth(true);
myGrid.enableAutoHeight(true);
myGrid.init();
gmenuData = new ActiveXObject('Microsoft.XMLDOM');
gmenuData.async = false;
gmenuData.loadXML(gridd);
//alert(gmenuData.xml)
//myGrid.load("common/grid.xml");
myGrid.load(gmenuData);
}
var gridd= '<rows>\
<row id="1">\
<cell>-1500</cell>\
<cell>A Time to Kill</cell>\
<cell>John Grisham</cell>\
<cell>12.99</cell>\
<cell>1</cell>\
<cell>24</cell>\
<cell>0</cell>\
<cell>05/01/1998</cell>\
</row>\
</rows>\
';
dhtmlXGridObject('gridbox') 資料源能不能支持xmldoc ??? 回答滿意可用分未結貼也領分。
uj5u.com熱心網友回復:
自解決了。自解決了。轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/149910.html
標籤:JavaScript
