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,怎么办?
展开
 我来答
百度网友dc81944bb
2009-11-30 · TA获得超过572个赞
知道小有建树答主
回答量:793
采纳率:0%
帮助的人:735万
展开全部
一是用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 +"' />";
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式