PDA

View Full Version : two checkbox in only one field



osmancorp
3 Sep 2010, 1:54 AM
Hello,

since I upgrade version from 3.0.3 to 3.2.1 . I have two checkbox in the same fields on my gridpanel. Here is how I instantiate Ext.grid.CheckboxSelectionModel :



this.sm = new Ext.grid.CheckboxSelectionModel({
singleSelect: false,
checkOnly: true,
fn: this,
header: 'Selection',
id: 'sm',
width: 60,
listeners: {
rowdeselect: function(sm, row_index, record){
sm.grid.ti.splice(sm.grid.ti.indexOf(record.get('ip')), 1);
sm.grid.th.splice(sm.grid.th.indexOf(record.get('hosts')), 1);
sm.grid.co--;
sm.grid.status.setText('Serveur(s) sélectionné(s) : ' + sm.grid.co)
},
rowselect: function(sm, row_index, record){
if (sm.isSelected(row_index)) {
sm.grid.ti[sm.grid.co] = record.get('ip');
sm.grid.th[sm.grid.co] = record.get('hosts');
sm.grid.co++;
sm.grid.status.setText('Serveur(s) sélectionné(s) : ' + sm.grid.co);
}
}
}


});



ColumnModel :


this.cm = new Ext.grid.ColumnModel([ this.sm ,

{header: 'Maintenance',dataIndex: 'id',hidden: false , renderer : this.cover_image}
,{header: 'id',readOnly: true,dataIndex: 'id',hidden: false}
,{header: 'hosts',dataIndex: 'hosts',hidden: false,width : 180}
,{header: 'ip',dataIndex: 'ip',hidden: false}
,{header: 'application',dataIndex: 'application',hidden: false}
,{header: 'os',dataIndex: 'os',hidden: false}
,{header: 'class',dataIndex: 'class',hidden: false}
,{header: 'domaine',dataIndex: 'domaine',hidden: false}
]);

Thank You


Sorry for my english language but i am french :)


Osmancorp

Condor
3 Sep 2010, 2:00 AM
The width:60 is the problem. The current css doesn't support that.

The best solution is probably to split the used checkbox image into an unchecked and a checked image and update the css rules accordingly.

osmancorp
3 Sep 2010, 2:06 AM
Ok it's perfect but now my header is too long for my field if i define width to 30.