PDA

View Full Version : Tripple state in editable Grid



pludikhu
3 Sep 2010, 10:43 PM
Hi all

I was trying to get a CycleButton in an editable grid cell, but it doesn't seem to work.


var cm = new Ext.grid.ColumnModel({
columns: [{
header: 'Light',
dataIndex: 'light',
width: 130,
editor: new Ext.CycleButton({
showText : true,
items : [
{ text : 'one', checked : true },
{ text : 'two' },
{ text : 'three' }
]
})
}]
...

I always get this.field.reset is not a function.

I suppose it's just meant to be used in menus. I read somewhere that it may be because it's not a field and something about inheritance but that's where Animal lost me :-(

Would there be an other way to have a three state 'checkbox' or something in a grid cell?

Don't make it too advanced please, I'm still no JS expert.

Thanks for any help I can get!

Patrick

laurentParis
4 Sep 2010, 10:40 PM
try to use CellActions plugin or RowActions

Condor
6 Sep 2010, 1:49 AM
An editor must be an Ext.form.Field or Ext.Editor instance and Ext.CycleButton is neither.

I suggest using a ComboBox editor instead (or RowActions - whatever you like better).

pludikhu
9 Sep 2010, 10:46 AM
I was going to use RowActions/CellActions now but it doesn't seem to be compatible with addField ...
Any input on that please, Condor?

Condor
9 Sep 2010, 11:20 AM
addField? Are you adding columns dynamically?

I don't think RowActions can handle that.

ps. Because of changes in Ext 3.3, ActionColumn (included as example with Ext 3.3. - behaves like RowActions) will work.