87,901
社区成员
发帖
与我相关
我的任务
分享
Ext.onReady(function () {
var tbar = new Ext.Toolbar({
height: 50,
items: [
new Ext.Button({
text: "button here",
handler: function (btn) {
Ext.MessageBox.alert("it's a button here!");
}
})
]
});
tbar.addButton([{text: "save"},{text: "close"}]); // 在这就能添加上这2个按钮
var p = new Ext.Panel({
tbar: tbar,
renderTo: Ext.getBody()
});
// 如果addButton写在这里就不行
});
Ext.onReady(function() {
var tbar = new Ext.Toolbar({
height: 50,
items: [new Ext.Button({
text: "button here",
handler: function(btn) {
Ext.MessageBox.alert("it's a button here!");
}
})]
});
var p = new Ext.Panel({
tbar: tbar,
renderTo: Ext.getBody()
});
// 如果addButton写在这里就不行
//写在这里是因为上面panel已经初始化了。
//这样写:
p.getTopToolbar().add([{
text: "save"
},
{
text: "close"
}]);
p.doLayout();
});
var grid = new Ext.grid.GridPanel
({
id: "MenuGridPanel",
title: '日志列表',
renderTo:"d",
layout: "fit",
width: "100%",
height: 520,
frame: true,
border: true,
columnLines: true,
autoScroll: true,
loadMask: {msg:'正在加载数据,请稍侯……'},
store: store,
sm: sm,
cm: cm,
autoExpandColumn:"edu",
plugins:expander,
clicksToEdit:1,
viewConfig: { forceFit: true,enableRowBody:true},
bbar: pagingBar,
tbar://Grid操作工具栏
[{
text:"审核",
cls: 'x-btn-text-icon details',
icon:"../../ext-3.1.0/blue16_074.gif",
handler:function(){
rows = Ext.getCmp("MenuGridPanel").getSelectionModel().getSelections();
if(rows.length==0)
{
Ext.Msg.alert("提示","请选择一行你要审核的日志!");
return;
}
if(rows.length>1)
{
Ext.Msg.alert("提示","一次只能审核一条日志");
return;
}
if(rows[0].json.IsAudit.indexOf("0")<0)
{
Ext.Msg.alert("提示","此日志已经审核");
return;
}
checkedf.getForm().reset();
// windowAudit.show();
UpdateCheckedShow();
}
},
'-',
{
text:"撤销审核",
cls: 'x-btn-text-icon details',
icon:"../../ext-3.1.0/blue16_062.gif",
handler:function(){
UndoCheck();
}
}
,'-',
{
text:"刷新",
cls: 'x-btn-text-icon details',
icon:"../../ext-3.1.0/blue16_074.gif",
handler:function(){
store.reload();
}
},'-',
{
text:"项目名称",
cls: 'x-btn-text-icon details',
icon:"../../ext-3.1.0/blue16_074.gif"
}
,'-',
ManageProject
,'-',
{
text:"项目状态",
cls: 'x-btn-text-icon details',
icon:"../../ext-3.1.0/blue16_074.gif"
},'-',
ProjectStatus
,'-',
{
text:"查找",
cls: 'x-btn-text-icon details',
icon:"../../ext-3.1.0/blue16_074.gif",
handler:function()
{
//Ext.Msg.alert('info',Ext.getCmp("ManageProject").getValue());
if(Ext.getCmp("ManageProject").getValue()!=""&&Ext.getCmp("ProjectStatus").getValue()=="")
{
store.filter('ProjectID',Ext.getCmp("ManageProject").getValue(),false,false);
}
if(Ext.getCmp("ProjectStatus").getValue()!=""&&Ext.getCmp("ManageProject").getValue()=="")
{
store.filter('IsAudit',Ext.getCmp("ProjectStatus").getValue(),false,false);
}
}
}
]
});