PDA

View Full Version : help! GridPanel cann't be displayed .



julyevil
7 Jun 2009, 10:43 PM
my develop invironment :

VS2005,XML,EXTJS2.2.1



//getprogressfiles.aspx
Ext.onReady(function(){
var storage= new Ext.data.Store({
fields:['FileId','FilePath','UserId','ProcessState','AddTime','UpdateTime'],
url:"../ajax/getprogressfiles.aspx?getby=paged&pageindex=1&pagesize=20",
reader:new Ext.data.XmlReader({
record:"ProgressFile",
totalRecords:"TotalRowCount",
id:"FileId"
},
['FileId','FilePath','UserId','ProcessState','AddTime','UpdateTime']
)
});

storage.setDefaultSort("FileId","Desc");

var gridBox = Ext.get("file-grid");

var pagingBar=new Ext.PagingToolbar({
pageSize:20,
store:storage,
displayInfo:true,
displayMsg: '????{0} - {1} ?{2}?',
emptyMsg: "?????",
beforePageText:"???",
afterPageText:"?{0}?",
items:[
"-", {
pressed: false,
enableToggle:true,
text: '??',
cls: 'x-btn-text-icon details',
toggleHandler: function(btn, pressed){
var view = grid.getView();
view.showPreview = pressed;
view.refresh();
}
}]
});

var grid = new Ext.grid.GridPanel({
el:"file-grid",
height:650,
autoExpandColumn:"true",
layout:"fit",
title:"????????",
store:storage,
trackMouseOver:true,
disableSelection:false,
loadMask:true,
colums:[{
id:"FileId",
header:"??ID",
dataIndex:"FileId",
width:100,
sortable:true
},{
header:"????",
dataIndex:"FilePath",
width:200,
sortable:false
},{
header:"????",
dataIndex:"ProcessState",
width:50,
sortable:true
},{
header:"????ID",
dataIndex:"UserId",
width:50,
sortable:false
},{
header:"????",
dataIndex:"AddTime",
width:150,
sortable:true
},{
header:"??????",
dataIndex:"UpdateTime",
width:150,
sortable:true
}],
// customize view config
viewConfig: {
forceFit:true,
enableRowBody:true,
showPreview:false,
getRowClass : function(record, rowIndex, p, store){
if(this.showPreview){
var lastIndex = record.data.SiteImageUrl.lastIndexOf(".");
var fileExt = record.data.SiteImageUrl.substring(lastIndex,record.data.SiteImageUrl.length);
var fileName = record.data.SiteImageUrl.substring(0,lastIndex);
p.body =String.format('<p><img src="http://op.bitauto.com/photo/{0}" /></p>',fileName+"_s"+fileExt);
return 'x-grid3-row-expanded';
}
return 'x-grid3-row-collapsed';
}
},
bbar:pagingBar
});

grid.render();

// trigger the data store load
storage.load({
params:{
start:0, limit:25
},
callback:function(records,options,success){
alert(records[1].data.UserId)
}
});
})

<ArrayOfProgressFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <ProgressFile> <FileInfoXml /> <ProcessState>1</ProcessState> <FileId>760</FileId> <UserId>418</UserId> <AddTime>2009-06-07T23:24:43</AddTime> <UpdateTime>2009-06-07T23:26:50</UpdateTime> <FilePath>E:\webroot\WebSystem\op.bitauto.com\Photo\Files\compressfile\yuanpf\7b503925-df90-44cb-8b3c-6e159e006107.rar</FilePath> </ProgressFile>- <ProgressFile> <FileInfoXml /> <ProcessState>1</ProcessState> <FileId>759</FileId> <UserId>471</UserId> <AddTime>2009-06-07T23:23:51</AddTime> <UpdateTime>2009-06-07T23:24:43</UpdateTime> <FilePath>E:\webroot\WebSystem\op.bitauto.com\Photo\Files\compressfile\fub\fa02fbe1-6de3-449f-9ea2-deb0c7e3327f.rar</FilePath> </ProgressFile></ArrayOfProgressFile>

FF3.0:
fire-bug msg:

ext-all-debug.js (line:32869)

cm is undefinedfitColumns()(true, false, undefined)ext-all-debug.js (? 32869 ?)render()()ext-all-debug.js (? 33110 ?)onRender()(Object dom=form#form1 id=form1 visibilityMode=1, null)ext-all-debug.js (? 31723 ?)render()(form#form1 showprogre...files.aspx, undefined)ext-all-debug.js (? 12847 ?)render()()ext-all-debug.js (? 14511 ?)(?)()()showprog...sfiles.js (? 103 ?)(?)()()ext-all-debug.js (? 1431 ?)var tw = cm.getTotalWidth(false);

sramanna
7 Jun 2009, 11:02 PM
It should be:

columns

You have it misspelled as colums.

That is the reason you are getting cm is undefined.

julyevil
9 Jun 2009, 5:57 PM
I was so carelessly. yes I made it .
thanks a ton .