PDA

View Full Version : checkbox as grid editor - passing state (not value) to handler



Webtel
20 Mar 2012, 3:46 AM
i have grid with edit plugin with a checkboxcolumn (not by selModel) that uses checkbox field

what can be done to get SubmitValue (one that is normaly submitted by form) of that chceckbox instead of checked/unchecked state bool while im in grid edit handler?

docs says :


e : Object (http://docs.sencha.com/ext-js/4-0/#!/api/Object)An edit event with the following properties:

value - The value being set


so maybe it is a bug ?? (clearly state is not a value)


class checkbox {
uncheckedValue:'0',
inputValue:'1'
}


PS. for now to get by i overriden checkbox.getValue to return getSubmitValue.

mitchellsimoens
20 Mar 2012, 8:56 AM
The editor needs to get the submit value instead of the value. What version are you using?

Webtel
20 Mar 2012, 11:11 PM
im on 4.0.7 still.

Webtel
21 Mar 2012, 11:12 PM
Well, as a temporary solution (but a very bad idea) i came up with such quick fix :



Ext.define('TS.lib.form.Checkbox',{
extend: 'Ext.form.field.Checkbox',
alias : 'widget.check',
uncheckedValue:0,
inputValue:1,
getValue:function(){
return this.rendered ? this.getSubmitValue() : this.value;
}
});


without rendered condition it might brake on form load.

It may have other problems attached too...