按钮列

使用Ext.ux.grid.RowActions.js,使用样例如下:

<script type="text/javascript" src="http://localhost/extjs/ux/Ext.ux.grid.RowActions.js"></script>

this.rowActions = new Ext.ux.grid.RowActions({
header:'操作'
,autoWidth:false
,hideMode:'display'
,keepSelection:true
,actions:[{
iconCls:'icon-publish'
,tooltip:'发布'
//,text:'发布'
,hideIndex:'PUBLISH'
,callback:function(grid, records, action,rowIndex,colIndex) {
Ext.Ajax.request( {
url :'info/changeStatus.do',
params : {
'id' :records.get('ID'),
'status' :'1'
},
method :'POST',
success : function(response) {
var r = Ext.decode(response.responseText);
if (!r.success)
Ext.Msg.alert('提示信息', '发布失败,由以下原因所致:<br/>'
+ (r.errors.msg ? r.errors.msg : '未知原因'));
else {
grid.store.reload();
}
},
scope :this
});
}
},{
iconCls:'icon-unpublish'
,tooltip:'撤回'
//,text:'撤回'
,hideIndex:'UNPUBLISH'
,callback:function(grid, records, action,rowIndex,colIndex) {
Ext.Ajax.request( {
url :'info/changeStatus.do',
params : {
'id' :records.get('ID'),
'status' :'2'
},
method :'POST',
success : function(response) {
var r = Ext.decode(response.responseText);
if (!r.success)
Ext.Msg.alert('提示信息', '发布失败,由以下原因所致:<br/>'
+ (r.errors.msg ? r.errors.msg : '未知原因'));
else {
grid.store.reload();
}
},
scope :this
});
}
},{
iconCls:'icon-totopas'
,tooltip:'置顶'
//,text:'置顶'
,hideIndex:'TOTOPAS'
,callback:function(grid, records, action,rowIndex,colIndex) {
Ext.Ajax.request( {
url :'info/changeTopas.do',
params : {
'id' :records.get('ID'),
'topas' :'1'
},
method :'POST',
success : function(response) {
var r = Ext.decode(response.responseText);
if (!r.success)
Ext.Msg.alert('提示信息', '置顶失败,由以下原因所致:<br/>'
+ (r.errors.msg ? r.errors.msg : '未知原因'));
else {
grid.store.reload();
}
},
scope :this
});
}
},{
iconCls:'icon-untopas'
,tooltip:'取消置顶'
//,text:'取消置顶'
,hideIndex:'UNTOPAS'
,callback:function(grid, records, action,rowIndex,colIndex) {
Ext.Ajax.request( {
url :'info/changeTopas.do',
params : {
'id' :records.get('ID'),
'topas' :'0'
},
method :'POST',
success : function(response) {
var r = Ext.decode(response.responseText);
if (!r.success)
Ext.Msg.alert('提示信息', '置顶失败,由以下原因所致:<br/>'
+ (r.errors.msg ? r.errors.msg : '未知原因'));
else {
grid.store.reload();
}
},
scope :this
});
}
},{
iconCls:'icon-view'
,tooltip:'预览'
//,text:'预览'
,callback:function(grid, records, action,rowIndex,colIndex) {
window.open('info/view.do?id='+records.get('ID'));
}
}]
});
this.plugins = [this.rowActions];
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

onlydo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值