Results 1 to 4 of 4

Thread: checkbox as grid editor - passing state (not value) to handler

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84

    Exclamation checkbox as grid editor - passing state (not value) to handler

    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 :
    Code:
    e : ObjectAn edit event with the following properties:
    
    value - The value being set
    

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

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

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

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    The editor needs to get the submit value instead of the value. What version are you using?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84

    Default

    im on 4.0.7 still.

  4. #4
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84

    Default

    Well, as a temporary solution (but a very bad idea) i came up with such quick fix :

    Code:
    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...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •