PDA

View Full Version : Check in a Grid Problem



afezuh_z
27 Nov 2007, 2:55 AM
Hello! :)

I am using Ext 2.O

Two columns for checkbox are appearing in a grid and it also not capturing the event of 'rowselect', 'rowdeselect', 'selctionchange', , I don't why



// custom column plugin example
this.checkColumn = new Ext.grid.CheckboxSelectionModel({
width: 55,
singleSelect: true
});
this.checkColumn.addListener('rowselect', checkBoxSelected);

userReader = new Ext.data.ArrayReader({}, [
{name: 'id'},
{name: 'fullName'},
{name: 'email'},
{name: 'noOfContact'},
{name: 'noOfElement'},
{name: 'recordSelect'}
]);

userColModel= new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{header: "ID", sortable: true, dataIndex: 'id', width: 10},
{header: "Full Name", sortable: true, dataIndex: 'fullName'},
{header: "Email", sortable: true, dataIndex: 'email'},
{header: "#Contact", sortable: true, dataIndex: 'noOfContact'},
{header: "#Element", sortable: true, dataIndex: 'noOfElement'},
checkColumn
]);

function createGrid(renderedOnComp, divId, gridData, reader, colModel){

Ext.QuickTips.init();

var xg = Ext.grid;
xg.dummyData= eval(gridData);

////////////////////////////////////////////////////////////////////////////////////////
// Grid 3
////////////////////////////////////////////////////////////////////////////////////////
var grid3 = new xg.EditorGridPanel({
store: new Ext.data.Store({
data: xg.dummyData,
reader: reader
}),
sm: new Ext.grid.RowSelectionModel({singleSelect:false}),
cm: colModel,
viewConfig: { forceFit: true },
renderTo: divId,
align: 'center',
width: tabPanel.width-3,
height: 400,
frame: 'false'
});

return grid3;
} // createUserGrid

danmat46
27 Nov 2007, 3:26 AM
new Ext.grid.RowNumberer(),
{header: "ID", sortable: true, dataIndex: 'id', width: 10},
{header: "Full Name", sortable: true, dataIndex: 'fullName'},
{header: "Email", sortable: true, dataIndex: 'email'},
{header: "#Contact", sortable: true, dataIndex: 'noOfContact'},
{header: "#Element", sortable: true, dataIndex: 'noOfElement'},
checkColumn



You mite need to display as:


new Ext.grid.RowNumberer(),
{header: "ID", sortable: true, dataIndex: 'id', width: 10},
{header: "Full Name", sortable: true, dataIndex: 'fullName'},
{header: "Email", sortable: true, dataIndex: 'email'},
{header: "#Contact", sortable: true, dataIndex: 'noOfContact'},
{header: "#Element", sortable: true, dataIndex: 'noOfElement'},
{dataIndex: 'recordsel???',checkColumn}

Only a guess I'm new to ExtJS but that sticks out.