extjs布局 中间显示一个表格,为什么center部分的数据总是不显示呢,本人新手,求大神解答!
<html><head><title>页面布局</title>...<script>Ext.onReady(function(){varstore=newExt.data...
<html>
<head>
<title>页面布局</title>
...
<script>
Ext.onReady(function(){
var store = new Ext.data.Store({
data: [
[
1,
"Office Space",
"Mike Judge",
"1999-02-19",
1,
"Work Sucks",
"19.95",
1
]
//...more rows of data removed for readability...//
],
reader: new Ext.data.ArrayReader({id:'id'},[
'id',
'title',
'director',
{name: 'released', type: 'date', dateFormat: 'Y-m-d'},
'genre',
'tagline',
'price',
'available'
]
)
});
var genres = new Ext.data.SimpleStore({
fields:['id','genre'],
data:[['1','喜剧'],['2','惊悚'],['3','动作']]
});
function genre_name(val){
return genres.queryBy(function(rec){
if(rec.data.id == val){
return true;
}else{
return false;
}
}).itemAt(0).data.genre;
}
var viewport=new Ext.Viewport({
layout:'border',
renderTo:Ext.getBody(),
items:[{
region:'north',
xtype:'panel',
split:true,
html:'North'
},{..
},{
region:'center',
xtype:'tabpanel',
activeTab:0,
items:[{
title:'Movie Grid',
store: store,
autoExpandColumn:'title',
columns: [
{header: 'Genre', dataIndex: 'genre', renderer: genre_name},
{header: "Director", dataIndex: 'director'},
{header: "Released", dataIndex: 'released',
renderer: Ext.util.Format.dateRenderer('m/d/Y')},
{header: "Genre", dataIndex: 'genre'},
{header: "Tagline", dataIndex: 'tagline', hidden:false},
{header: "Price", dataIndex: 'price', sortable: true},
{header: "Available", dataIndex: 'available'}
]
},{
title:'Movies Grid',
html:'Center2'
}]
},{...
}]
});
});
</script>
</head>
<body>
<!‐‐ Nothing in the body ‐‐>
</body>
</html> 展开
<head>
<title>页面布局</title>
...
<script>
Ext.onReady(function(){
var store = new Ext.data.Store({
data: [
[
1,
"Office Space",
"Mike Judge",
"1999-02-19",
1,
"Work Sucks",
"19.95",
1
]
//...more rows of data removed for readability...//
],
reader: new Ext.data.ArrayReader({id:'id'},[
'id',
'title',
'director',
{name: 'released', type: 'date', dateFormat: 'Y-m-d'},
'genre',
'tagline',
'price',
'available'
]
)
});
var genres = new Ext.data.SimpleStore({
fields:['id','genre'],
data:[['1','喜剧'],['2','惊悚'],['3','动作']]
});
function genre_name(val){
return genres.queryBy(function(rec){
if(rec.data.id == val){
return true;
}else{
return false;
}
}).itemAt(0).data.genre;
}
var viewport=new Ext.Viewport({
layout:'border',
renderTo:Ext.getBody(),
items:[{
region:'north',
xtype:'panel',
split:true,
html:'North'
},{..
},{
region:'center',
xtype:'tabpanel',
activeTab:0,
items:[{
title:'Movie Grid',
store: store,
autoExpandColumn:'title',
columns: [
{header: 'Genre', dataIndex: 'genre', renderer: genre_name},
{header: "Director", dataIndex: 'director'},
{header: "Released", dataIndex: 'released',
renderer: Ext.util.Format.dateRenderer('m/d/Y')},
{header: "Genre", dataIndex: 'genre'},
{header: "Tagline", dataIndex: 'tagline', hidden:false},
{header: "Price", dataIndex: 'price', sortable: true},
{header: "Available", dataIndex: 'available'}
]
},{
title:'Movies Grid',
html:'Center2'
}]
},{...
}]
});
});
</script>
</head>
<body>
<!‐‐ Nothing in the body ‐‐>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询