PDA

View Full Version : combo in cellediting grid



gurunath
3 Jul 2012, 11:04 PM
I am using cell-editor in grid
I use one combo in grid but combo shows some magical value if default value is not set like

<div unselectable="on" class="x-grid-cell-inner x-unselectable" style="; text-align: left;">&nbsp;</div>

what is it and how to remove this please help me

Romick
4 Jul 2012, 12:36 AM
Hi! try to set type: 'auto' to your field.
Also I have some examples for you here.
http://www.sencha.com/forum/showthread.php?220347-Editable-combobox-in-treepanel-shows-Object-object-in-edit-mode.

gurunath
4 Jul 2012, 12:51 AM
@Romick (http://www.sencha.com/forum/member.php?324607-Romick)
I am not getting what is type: 'auto'

can you please help me

Romick
4 Jul 2012, 1:05 AM
When you defining a treestore


Ext.create('Ext.data.TreeStore', {
model: me.buildTaskModel('Task', fields),
...

your fields are like:


var fields = [
{name: 'text', type: 'string'},
{name: 'user', type: 'auto'}
];

Romick
4 Jul 2012, 1:06 AM
Also can you post your column config or some test case.

gurunath
4 Jul 2012, 1:15 AM
auto is not working for me

and here is my column model




[{ "header": "ID", "dataIndex": "recid_c", "width": 60, "filterable": true, }, { "header": "Style", "dataIndex": "style_c", "width": 85, "filterable": true, editor: { fieldLabel: '', xtype: 'style', allowBlank: false, valueField: "name_c", emptyText: 'select', value: 'Inshell', msgTarget: 'side', enableKeyEvents: true, listeners: { select: function(cmb){
alert(cmb.value);
} } } }]

scottmartin
17 Jul 2012, 6:13 PM
What is xtype: 'style'?




editor: {
fieldLabel: '',
xtype: 'style', // should be 'combo'
allowBlank: false,
valueField: "name_c",
emptyText: 'select',
value: 'Inshell',
msgTarget: 'side',
enableKeyEvents: true,
listeners: {
select: function(cmb) {
alert(cmb.value);
}
}
}


Scott.

gurunath
18 Jul 2012, 9:14 PM
ohhh i forgot 'style' is my class which is inherits from combo as



Ext.define('ND.dropdowns.Style', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.style',
fieldLabel:'Style',

initComponent: function() {
Ext.apply(this, {
id:'Style',
fieldwidth:100,
fieldLabel:this.fieldLabel,
defaultValue:this.defaultValue,
value:this.value,
store: 'ND.store.Style,
displayfield : 'name',
valuefield : 'recid'
});
this.callParent();
}
});

Romick
18 Jul 2012, 11:36 PM
Do you really think that with such name as 'style', 'document', 'window', 'name', 'id' your combo will work better? Try to use not reserved words and you have avoid a lot of prodlems.

scottmartin
19 Jul 2012, 5:03 AM
I would have to agree with the selection of your name.. perhaps 'combostyle' if you need 'style' in the name or alike.

Have you checked the store to make sure it's values are correct?

Scott.