1. #1
    Touch Premium Member
    Join Date
    Mar 2011
    Posts
    26
    Vote Rating
    1
    Answers
    1
    gubespam is on a distinguished road

      0  

    Question Unanswered: Correct usage of Ext.Editor.ignoreNoChange?

    Unanswered: Correct usage of Ext.Editor.ignoreNoChange?


    I'd like to use the "ignoreNoChange" config of Ext.Editor for the cell editors in my grid panel. What is the correct way to set up the config for the grid panel? I assumed I could just add a config key to the "editor" config, but that doesn't work.

    Code:
    columns: [
      {
          header: 'Length',
          dataIndex: 'externalField.fieldLength',
          type: 'number',
          editor: {
              xtype: 'numberfield',
              minValue: 1,
              ignoreNoChange: true
          }
      }, ...
    Looking at the source, it appears that the editor config is stored as the "field" member object of Ext.Editor (so access should be as "this.field.ignoreNoChange"), but the code is checking against me/this.ignoreNoChange instead. Is this a bug?

    Code:
            if (String(value) === String(me.startValue) && me.ignoreNoChange) {
                me.hideEdit(remainVisible);
                return;
            }

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,616
    Vote Rating
    327
    Answers
    545
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    It isn't entirely clear to me how the various config options of an Ext.Editor are supposed to be used as it is usually created implicitly. Something like this perhaps?

    Code:
    editor: {
        ignoreNoChange: true,
        xtype: 'editor',
        field: {
            minValue: 1,
            xtype: 'numberfield'
        }
    }
    Not sure if that would work or not. Alternatively, it seems that the getEditor() method on a column is designed to be able to return an editor, so you could try overriding that (just specify it in your column config).

Thread Participants: 1

Tags for this Thread