ext插入checkbox

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:15:07
{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,怎么办?

一是用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