ExtJs 窗体集 FormSet (WEBFormSet)
<script language="JavaScript">
<!--
/*
* 收集: 部分 extjs 实用控件集合 By Winner 2008年8月15日11:09:37
*
*/
//表单控件集合
this.CenterTop = new Ext.form.FormPanel({
height: 211,
bodyStyle : 'padding:6px',
region : 'north', //
split : true,
items:[
{xtype:'hidden',name:'Id'},
{xtype:'textfield',name:'SDDM',fieldLabel:'代码'},
{xtype:'textfield',name:'SDMC',fieldLabel:'名称'},
{xtype:'textfield',name:'QDMC',fieldLabel:'渠道'} ]
});
//多页控件集合
this.CenterBottom= new Ext.TabPanel({
region : 'center',
split : true,
height: 311,
activeTab: 0,
frame:true,
defaults:{autoHeight: true},
items:[
{
title:'附页1',
layout:'fit',
items:[
{xtype:'hidden',name:'Id'},
{xtype:'textfield',name:'SDDM',fieldLabel:'代码',value:'abcd'},
{xtype:'textfield',name:'SDMC',fieldLabel:'名称'},
{xtype:'textfield',name:'QDMC',fieldLabel:'渠道'} ]
},
{
title:'附页2',
layout:'fit',
items:[
{xtype:'hidden',name:'Id'},
{xtype:'textfield',name:'SDDM',fieldLabel:'代码',value:'ccc'},
{xtype:'textfield',name:'SDMC',fieldLabel:'名称'} ]
}
]
});
//网格分页控件
this.cm=new Ext.grid.ColumnModel([
{ header: '代码',dataIndex: 'SDDM', width:111 },
{ header: '名称',dataIndex: 'SDMC', width:111 }
]);
this.storeMapping=['Id','SDDM','SDMC','QD_ID','QDDM','QDMC'];
this.store=new Ext.data.JsonStore({
id:"Id",
url: 'SingleTable.aspx?TableName=shangdian&Controller=List' , //return JSON:{'Pages':'2' , 'CurrentPage':'3','PageSize':'12','NextPage':'4','PreviousPage':'1', 'RowCount':'99','Result':[{"SDDM":"001","SDMC":"商店1","QD_ID":2,"QDDM":"021","QDMC":"上海","Id":1},{"SDDM":"003","SDMC":"商店2","QD_ID":2,"QDDM":"021","QDMC":"上海","Id":2}] }
root:"Result",
totalProperty:"RowCount",
remoteSort:true,
fields:this.storeMapping //OK
});
this.grid=new Ext.grid.GridPanel({ //动态分页grid
store: this.store,
width:150,
split : true ,
cm: this.cm, //OK
trackMouseOver:false,
region:"west",
loadMask: true,
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: this.store,
displayInfo: true,
displayMsg: '第{0}-{1}条记录 共{2}',
emptyMsg: "没有记录信息"
})
});
this.store.load();
//已步树型控件
this.Treeleft=new Ext.tree.TreePanel({ ///左边树效果
title:'大类',
split : true,
region:'west',
width:150,
root:new Ext.tree.AsyncTreeNode({
id:'root',
text:'大类',
expanded:true,
loader: new Ext.tree.TreeLoader( {
url : 'BSDBTreeSingleBuss.aspx?Controller=TreeList&TableName=dalei', //return JSON: [{"text" :"a" , "qtip" :"a" ,"id" :"1" ,"cls" :"folder",leaf: false } ,{"text" :"w", "qtip" :"w" ,"id":"2" ,"cls" :"folder" ,leaf: true}]
listeners : {
'beforeload' : function(treeLoader, node) {
treeLoader.baseParams.id = (node.id != 'root' ? node.id : '');
}
}
})
})
});
//-->
</script>
<!--
/*
* 收集: 部分 extjs 实用控件集合 By Winner 2008年8月15日11:09:37
*
*/
//表单控件集合
this.CenterTop = new Ext.form.FormPanel({
height: 211,
bodyStyle : 'padding:6px',
region : 'north', //
split : true,
items:[
{xtype:'hidden',name:'Id'},
{xtype:'textfield',name:'SDDM',fieldLabel:'代码'},
{xtype:'textfield',name:'SDMC',fieldLabel:'名称'},
{xtype:'textfield',name:'QDMC',fieldLabel:'渠道'} ]
});
//多页控件集合
this.CenterBottom= new Ext.TabPanel({
region : 'center',
split : true,
height: 311,
activeTab: 0,
frame:true,
defaults:{autoHeight: true},
items:[
{
title:'附页1',
layout:'fit',
items:[
{xtype:'hidden',name:'Id'},
{xtype:'textfield',name:'SDDM',fieldLabel:'代码',value:'abcd'},
{xtype:'textfield',name:'SDMC',fieldLabel:'名称'},
{xtype:'textfield',name:'QDMC',fieldLabel:'渠道'} ]
},
{
title:'附页2',
layout:'fit',
items:[
{xtype:'hidden',name:'Id'},
{xtype:'textfield',name:'SDDM',fieldLabel:'代码',value:'ccc'},
{xtype:'textfield',name:'SDMC',fieldLabel:'名称'} ]
}
]
});
//网格分页控件
this.cm=new Ext.grid.ColumnModel([
{ header: '代码',dataIndex: 'SDDM', width:111 },
{ header: '名称',dataIndex: 'SDMC', width:111 }
]);
this.storeMapping=['Id','SDDM','SDMC','QD_ID','QDDM','QDMC'];
this.store=new Ext.data.JsonStore({
id:"Id",
url: 'SingleTable.aspx?TableName=shangdian&Controller=List' , //return JSON:{'Pages':'2' , 'CurrentPage':'3','PageSize':'12','NextPage':'4','PreviousPage':'1', 'RowCount':'99','Result':[{"SDDM":"001","SDMC":"商店1","QD_ID":2,"QDDM":"021","QDMC":"上海","Id":1},{"SDDM":"003","SDMC":"商店2","QD_ID":2,"QDDM":"021","QDMC":"上海","Id":2}] }
root:"Result",
totalProperty:"RowCount",
remoteSort:true,
fields:this.storeMapping //OK
});
this.grid=new Ext.grid.GridPanel({ //动态分页grid
store: this.store,
width:150,
split : true ,
cm: this.cm, //OK
trackMouseOver:false,
region:"west",
loadMask: true,
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: this.store,
displayInfo: true,
displayMsg: '第{0}-{1}条记录 共{2}',
emptyMsg: "没有记录信息"
})
});
this.store.load();
//已步树型控件
this.Treeleft=new Ext.tree.TreePanel({ ///左边树效果
title:'大类',
split : true,
region:'west',
width:150,
root:new Ext.tree.AsyncTreeNode({
id:'root',
text:'大类',
expanded:true,
loader: new Ext.tree.TreeLoader( {
url : 'BSDBTreeSingleBuss.aspx?Controller=TreeList&TableName=dalei', //return JSON: [{"text" :"a" , "qtip" :"a" ,"id" :"1" ,"cls" :"folder",leaf: false } ,{"text" :"w", "qtip" :"w" ,"id":"2" ,"cls" :"folder" ,leaf: true}]
listeners : {
'beforeload' : function(treeLoader, node) {
treeLoader.baseParams.id = (node.id != 'root' ? node.id : '');
}
}
})
})
});
//-->
</script>