1. #11
    Ext User
    Join Date
    Nov 2007
    Posts
    3
    Vote Rating
    0
    veroxii is on a distinguished road

      0  

    Default


    Quote Originally Posted by simo View Post
    you can add an else with the if ,to set the value of combobox to null
    Yes, but your code references the object by name...

    The proper clean way to override the function, and which works fine for me is the following:

    Code:
    Ext.override(Ext.form.ComboBox, {
        // private
        doForce : function() {
            if (this.el.dom.value != this.emptyText && this.el.dom.value.length > 0) {
                this.el.dom.value = this.lastSelectionText === undefined? '' : this.lastSelectionText;
                this.applyEmptyText();
            } else {
                this.clearValue();
            }
        }    
    });
    -V

  2. #12
    Ext User
    Join Date
    May 2009
    Posts
    34
    Vote Rating
    1
    george4kenco is on a distinguished road

      0  

    Default


    This override:
    1) did not work for me, the value is still being set back to empty text
    2) at least from reading the code, the above seems like what this override would do. I mean, semantically there does not seem to be a lot of difference between applyEmptyText() and clearValue(). Semantics aside, its obvious that the first condition does not retain the value of "this.el.dom.value"

    Quote Originally Posted by veroxii View Post
    Yes, but your code references the object by name...

    The proper clean way to override the function, and which works fine for me is the following:

    Code:
    Ext.override(Ext.form.ComboBox, {
        // private
        doForce : function() {
            if (this.el.dom.value != this.emptyText && this.el.dom.value.length > 0) {
                this.el.dom.value = this.lastSelectionText === undefined? '' : this.lastSelectionText;
                this.applyEmptyText();
            } else {
                this.clearValue();
            }
        }    
    });
    -V

  3. #13
    Ext User
    Join Date
    May 2009
    Posts
    34
    Vote Rating
    1
    george4kenco is on a distinguished road

      0  

    Default


    Without delving into the arcana surrounding lastSelectionText because, after all, I'm trying to write a business application here, as opposed to a Javascript framework, isn't the following what is actually correct, retaining the value of this.el.dom.value as appropriate?

    Code:
    Ext.override(Ext.form.ComboBox, {
        // private
        doForce : function() {
            if (this.el.dom.value != this.emptyText && this.el.dom.value.length > 0) {
                this.el.dom.value = this.lastSelectionText === undefined? this.el.dom.value : this.lastSelectionText;
                this.applyEmptyText();
            } else {
                this.clearValue();
            }
        }
    });

  4. #14
    Ext User
    Join Date
    May 2009
    Posts
    34
    Vote Rating
    1
    george4kenco is on a distinguished road

      0  

    Default


    Damn I guess I have to delve into lastSelectionText because thinking about it, this would actually seem to revert to the behavior that forceSelection is trying to prevent. Problem is, in my case, lastSelectionText is coming through as undefined

    Supreme WTFY

    Quote Originally Posted by george4kenco View Post
    Without delving into the arcana surrounding lastSelectionText because, after all, I'm trying to write a business application here, as opposed to a Javascript framework, isn't the following what is actually correct, retaining the value of this.el.dom.value as appropriate?

    Code:
    Ext.override(Ext.form.ComboBox, {
        // private
        doForce : function() {
            if (this.el.dom.value != this.emptyText && this.el.dom.value.length > 0) {
                this.el.dom.value = this.lastSelectionText === undefined? this.el.dom.value : this.lastSelectionText;
                this.applyEmptyText();
            } else {
                this.clearValue();
            }
        }
    });

  5. #15
    Ext User
    Join Date
    May 2009
    Posts
    34
    Vote Rating
    1
    george4kenco is on a distinguished road

      0  

    Default


    As it turns out, the supreme wtfy is on our end, we are overriding onSelect in such a way that setValue is not getting called, which in turn sets lastSelectionText; since its not getting set, my combobox never retains its value.

    Quote Originally Posted by george4kenco View Post
    Damn I guess I have to delve into lastSelectionText because thinking about it, this would actually seem to revert to the behavior that forceSelection is trying to prevent. Problem is, in my case, lastSelectionText is coming through as undefined

    Supreme WTFY

  6. #16
    Ext User
    Join Date
    May 2009
    Posts
    34
    Vote Rating
    1
    george4kenco is on a distinguished road

      0  

    Default


    So what I'm now doing at the top of our override is the following, it may not be ideal, but it has a similar effect to the call to setValue in onSelect (when the latter is not overridden):

    Code:
    this.lastSelectionText=record.data[this.valueField || this.displayField];
    Additionally, apologies the attitude

    Quote Originally Posted by george4kenco View Post
    As it turns out, the supreme wtfy is on our end, we are overriding onSelect in such a way that setValue is not getting called, which in turn sets lastSelectionText; since its not getting set, my combobox never retains its value.

  7. #17
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by george4kenco View Post
    So what I'm now doing at the top of our override is the following, it may not be ideal, but it has a similar effect to the call to setValue in onSelect (when the latter is not overridden):

    Code:
    this.lastSelectionText=record.data[this.valueField || this.displayField];
    Additionally, apologies the attitude
    are you still on 2.1, or have you upgraded to 2.3.0?

  8. #18
    Ext User
    Join Date
    May 2009
    Posts
    34
    Vote Rating
    1
    george4kenco is on a distinguished road

      0  

    Default


    Quote Originally Posted by mystix View Post
    are you still on 2.1, or have you upgraded to 2.3.0?
    2.2 actually

  9. #19
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by george4kenco View Post
    2.2 actually
    hmmm... you might want to bite the bullet and try 2.3.0.
    there's been a ton (quite literally) of fixes between 2.2 and 2.3.0, and i think this might just be one of them.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar