87,907
社区成员
发帖
与我相关
我的任务
分享
var form=Ext.create("Ext.form.Panel",{/*..配置..*/});
Ext.apply(this,{
id: 'content_panel',
region: 'center',
defaults: {
autoScroll:true,
bodyPadding: 10
},
activeTab: 0,
border: false,
//plain: true,
items: [form,panel]
});
试试。Ext.define('SoYi.view.TabPanel',{
extend: 'Ext.tab.Panel',
alias: 'widget.sytablepanel',
initComponent : function(){
var panel = Ext.create("Ext.grid.Panel",{
store:'conferenceinfo_store',
selModel: selModel,
columns: pageVar.confcolumns,
errorSummary:false,
title: '会议信息管理',
id:'会议信息管理12',
columnLines: true,
bodyPadding:0,
closable: true,
bbar: Ext.create('Ext.PagingToolbar', {
store:'conferenceinfo_store',
pageSize: 20,
displayInfo: true,
displayMsg: '显示 {0} - {1} 条,共计 {2} 条',
emptyMsg: '没有数据'
}),
dockedItems: [{
xtype: 'toolbar',
items: [{
itemId: 'addButton',
text: '添加',
tooltip:'新增', //显示提示
iconCls:'icon-add',
handler: function() {
showConfWindow( 'add' );
}
}, '-', {
itemId: 'modifyButton',
text: '修改',
iconCls:'modify',
disabled: true,
handler: function() {
var selection = panel.getView().getSelectionModel().getSelection();
if(selection.length>1){
Ext.MessageBox.alert("提示", "只能选择一条信息进行编辑");
}else{
showConfWindow( 'modify', '会议信息管理12' );
}
}
},'-', {
itemId: 'removeButton',
text: '删除',
iconCls: 'icon-delete',
disabled: true,
handler: function(){
var selection = panel.getView().getSelectionModel().getSelection();
var idAll = "";
for(var i = 0; i < selection.length; i++){
idAll += selection[i].get('id');
if(i<selection.length-1){
idAll = idAll + ",";
}
}
var panelStore = this.up("panel").getStore();
if (selection) {
Ext.MessageBox.confirm("标题", "数据不可恢复,您确定删除此信息吗?", function (btn) {
if(btn == 'yes'){
pageVar.deleteurl = pageVar.baspath + '/json/deleteUnit.xhtml';
deleteData(idAll,'会议信息管理12');
}
});
}
}
}, '-' ,{
text:'刷新数据',
iconCls:'icon-refresh',
handler:function(){
var panelStore = this.up("panel").getStore();
var currPage = panelStore.currentPage;
panelStore.removeAll();
panelStore.load(currPage);
}
},'->','单位名称',new Ext.form.Field(),'省份',new Ext.form.Field(),{
text:'查询',
handler: function () {
// store.load({ params: { keyword: filed1.getValue()} });
}
}]
}],
listeners: {
'selectionchange': function(view, records) {
panel.down('#modifyButton').setDisabled(!records.length);
panel.down('#removeButton').setDisabled(!records.length);
}
}
});
Ext.apply(this,{
id: 'content_panel',
region: 'center',
defaults: {
autoScroll:true,
bodyPadding: 10
},
activeTab: 0,
border: false,
//plain: true,
items: panel
});
this.callParent(arguments);
}
})
var _store = applyUserGrid.getStore();//拿到你要加载的数据
_store.on('beforeload', function (s) {//绑定事件
s.baseParams = {//带上你的条件
start: 0,
limit: 30,
activeId: _activeId,
beginDate: _beginDate,
endDate: _endDate,
flag: _flag,
ticketType: _ticketType
};
});
store.load({ params: {ok:1,name:'abc'} });
将表单组合成{ok:1,name:'abc'}这种json数据