
ext插入checkbox
{id:'id',header:"标题",dataIndex:'title',width:320},{header:"文本",dataIndex:'text',width...
{id: 'id', header: "标题", dataIndex: 'title', width: 320 },
{header: "文本", dataIndex: 'text', width: 200 },
{header: "初始时间", dataIndex: 'txtime', width: 100 },
{header: "结束时间", dataIndex: 'fbtime', width: 100 },
{header: "作者", dataIndex: 'txr', width: 100 },
怎样在最前端插入一个checkbox?
但是用了第一种却选中不了checkbox,怎么办? 展开
{header: "文本", dataIndex: 'text', width: 200 },
{header: "初始时间", dataIndex: 'txtime', width: 100 },
{header: "结束时间", dataIndex: 'fbtime', width: 100 },
{header: "作者", dataIndex: 'txr', width: 100 },
怎样在最前端插入一个checkbox?
但是用了第一种却选中不了checkbox,怎么办? 展开
1个回答
展开全部
一是用ext自带的。
var sm = new Ext.grid.CheckboxSelectionModel();
new Ext.grid.GridPanel({
store:store ,
columns: [
sm,
{id: 'id', header: "标题", dataIndex: 'title', width: 320 },
{header: "文本", dataIndex: 'text', width: 200 },
{header: "初始时间", dataIndex: 'txtime', width: 100 },
{header: "结束时间", dataIndex: 'fbtime', width: 100 },
{header: "作者", dataIndex: 'txr', width: 100 }
],
sm:sm
})
二就自己做。。
new Ext.grid.GridPanel({
store:store ,
columns: [
{header: "<input id='allcheckbox' type='checkbox' onclick=checkall(this) />", renderer:changCheck,width: 10, dataIndex: 'addsid'}
{id: 'id', header: "标题", dataIndex: 'title', width: 320 },
{header: "文本", dataIndex: 'text', width: 200 },
{header: "初始时间", dataIndex: 'txtime', width: 100 },
{header: "结束时间", dataIndex: 'fbtime', width: 100 },
{header: "作者", dataIndex: 'txr', width: 100 }
]
})
function changCheck(value, cellmeta, record, rowIndex, columnIndex, store){
return "<input style='margin-top:-5px;' type='checkbox' name='adds_checkbox' onclick=oneclick() id='adds_checkbox"+ value +"' />";
}
var sm = new Ext.grid.CheckboxSelectionModel();
new Ext.grid.GridPanel({
store:store ,
columns: [
sm,
{id: 'id', header: "标题", dataIndex: 'title', width: 320 },
{header: "文本", dataIndex: 'text', width: 200 },
{header: "初始时间", dataIndex: 'txtime', width: 100 },
{header: "结束时间", dataIndex: 'fbtime', width: 100 },
{header: "作者", dataIndex: 'txr', width: 100 }
],
sm:sm
})
二就自己做。。
new Ext.grid.GridPanel({
store:store ,
columns: [
{header: "<input id='allcheckbox' type='checkbox' onclick=checkall(this) />", renderer:changCheck,width: 10, dataIndex: 'addsid'}
{id: 'id', header: "标题", dataIndex: 'title', width: 320 },
{header: "文本", dataIndex: 'text', width: 200 },
{header: "初始时间", dataIndex: 'txtime', width: 100 },
{header: "结束时间", dataIndex: 'fbtime', width: 100 },
{header: "作者", dataIndex: 'txr', width: 100 }
]
})
function changCheck(value, cellmeta, record, rowIndex, columnIndex, store){
return "<input style='margin-top:-5px;' type='checkbox' name='adds_checkbox' onclick=oneclick() id='adds_checkbox"+ value +"' />";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询