关于extjs 在grid中添加按钮的问题,请教
我定义的ext grid如下:
function setGrid() {
var cm = new Ext.grid.ColumnModel([
{header:'ID',dataIndex:'id',hidden:true},
{header:'名',dataIndex:'title'},
{header:'sort',dataIndex:'fileComment'},
{header:'登陆者',dataIndex:'wfWaitUserName'},
{header:'所属',dataIndex:'wfWaitSecName'},
{header:'开始日',dataIndex:'wfCreateDate'}
]);
var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'WorkFlowListAction.do?dispatch=selectList'}),
reader: new Ext.data.JsonReader({
totalProperty: 'totalProperty',
root: 'root'
}, [
{name: 'id',mapping:'id',type:'string'},
{name: 'title',mapping:'title',type:'string'},
{name: 'fileComment',mapping:'fileComment',type:'string'},
{name: 'wfWaitUserName',mapping:'wfWaitUserName',type:'string'},
{name: 'wfWaitSecName',mapping:'wfWaitSecName',type:'string'},
{name: 'wfCreateDate',mapping:'wfCreateDate',type:'string'}
])
});
var pagingtoolbar = new Ext.PagingToolbar({
pageSize:3,
store:ds,
displayInfo:true,
emptyMsg:""
})
var grid = new Ext.grid.GridPanel({
store:ds,
cm: cm,
loadMask: {msg:"NOW LOADING……"},
region: 'center',
enableHdMenu:false,
enableColumnHide:false,
height:200,
width:800,
renderTo:"reservationlist",
bbar:pagingtoolbar
});
ds.load({params:{start:pagingtoolbar.getPageData().activePage - 1,limit:pagingtoolbar.pageSize}});
}
请问我如何才能在这个grid的每一行加上加一个按钮列?
------解决方案--------------------
帮顶~
------解决方案--------------------
ext不大熟悉,不过dojo里面column里面有属性指向一个方法,方法的返回值是自定义HTML,这样什么都可以定义了,ext应该类似吧,看看在grid渲染前可不可以加