1. #41
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,407
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default


    Quote Originally Posted by danh2000 View Post
    @stever

    Do you have an example or can you elaborate on the getRawValue and beforeblur issues that you experienced - I actually haven't looked at or thought too much about getRawValue and how it should work - as this component has multiple values it's not quite the same as combo - if you (or anyone) has thoughts or suggestions, I'd appreciate hearing them.
    Try using the newest version of Ext 3 from SVN (maybe RC2). I think you will see that the fields go blank on blur. Not such a great user experience!

    Anyhow, when content is changed (valid data that is), a hidden field ought to be updated with the value, and getRawValue would just return that.

  2. #42
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    Quote Originally Posted by stever View Post
    Try using the newest version of Ext 3 from SVN (maybe RC2). I think you will see that the fields go blank on blur. Not such a great user experience!

    Anyhow, when content is changed (valid data that is), a hidden field ought to be updated with the value, and getRawValue would just return that.
    Steve, I can't reproduce your blur issue - it's possible there is a bug or regression in the version of Ext 3 you are using - the recent RC 2 release actually fixed a couple of bugs that occured with this component and RC 1.1.

    Your description of how you think getRawValue should work is exactly how getValue currently works - valid values are stored, and when getValue is called it returns those values (delimited).

    Your suggestion is also different to how ComboBox (well Field actually) works - the getRawValue method returns the current value of the input el whether valid or not.

    Obviously the biggest difference between this component and ComboBox is that there are multiple values - the input el is less relevant from a raw value point of view - it will always be different to the underlying value of the component when selection/s have been made which brings me to the dilemma of what getRawValue should return.

    If you have use case/s with example data that explains your thoughts better, I'll be more than happy to have a look.

    Thanks,

    Dan

  3. #43
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by stever View Post
    Try using the newest version of Ext 3 from SVN (maybe RC2). I think you will see that the fields go blank on blur.
    I haven't tested / tried this ux, but you may be interested in this thread:
    http://extjs.com/forum/showthread.ph...650#post337650

  4. #44
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
    radtad is on a distinguished road

      0  

    Default


    I'm trying to use the SuperSelectBox with Ext 2.2 in a form and this is basically what I'm doing. I'm disabling the form while the data is updating the form then enabling the form. This causes problems with the box.

    1. I cannot use Box.addItem() as you can't set the value if the form is disabled. Don't you think there should be an override feature? Or maybe it really shouldn't be checking for disabled. I would assume the only way in setting a value (if the person is the end user) is through some sort of button. I think the button should be checking for a disabled form rather then in the addItem function....just my thoughts.

    2. I cannot use the following config at all.

    Code:
    renderFieldBtns: false
    form disabled (it will not generate the form window)...
    Code:
    this.buttonClear is undefined
    this.buttonClear.removeAllListeners();
    SuperBoxSelect.js (line 216)
    this.buttonClear is undefined
    this.buttonClear.addClassOnOver('x-superboxselect-btn-over')
    form enabled (everything seems fine, but it won't do addItem)...
    Code:
    this.buttonClear is undefined
    this.buttonClear.addClassOnOver('x-superboxselect-btn-over')
    Last edited by radtad; 8 Jun 2009 at 4:15 PM. Reason: forgot to mention

  5. #45
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
    radtad is on a distinguished road

      0  

    Default


    Quote Originally Posted by danh2000 View Post
    @radtad - some good suggestions thanks - I'll consider adding them. I'm not sure I see the use case for mid-word pattern matching (if I understand you correctly), but I like the others.
    Let's see if I can give you an example:

    I have a name "Chris" I'm trying to find because that's what he told me his name is. But his first name is actually "John" and his middle name is "Chris". So the display field would normally be {First Name} {Middle Name} {Last Name} i.e. "John Chris Doe". With no mid-word pattern matching available, if I didn't know Chris' real name was John, I'd never get his name as a return match.


    A big use case for our company comes down to email addresses. Currently I have "Tad Johnston (rad)" as the display field, "rad" being the email address. A lot of people here often times do not know the person's actual name, but they always know their email address because it's something they see often. Now, if I don't have mid-word pattern matching I can never find "rad".

    Another suggestion which would be even better would be matching on more then just the displayField, possibly in the store. Then I wouldn't have to worry about mid word pattern matching whatsoever.

    Hope this makes sense....

  6. #46
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    @radtad, thanks for the reports.

    Quote Originally Posted by radtad View Post
    I'm trying to use the SuperSelectBox with Ext 2.2 in a form and this is basically what I'm doing. I'm disabling the form while the data is updating the form then enabling the form. This causes problems with the box.

    1. I cannot use Box.addItem() as you can't set the value if the form is disabled. Don't you think there should be an override feature? Or maybe it really shouldn't be checking for disabled. I would assume the only way in setting a value (if the person is the end user) is through some sort of button. I think the button should be checking for a disabled form rather then in the addItem function....just my thoughts.
    Maybe I shouldn't check for the disabled state when programatically interacting with the component - I'll have a look at the other Ext form controls and follow suit.

    Quote Originally Posted by radtad View Post

    2. I cannot use the following config at all.

    Code:
    renderFieldBtns: false
    form disabled (it will not generate the form window)...
    Code:
    this.buttonClear is undefined
    this.buttonClear.removeAllListeners();
    SuperBoxSelect.js (line 216)
    this.buttonClear is undefined
    this.buttonClear.addClassOnOver('x-superboxselect-btn-over')
    Thanks, in the onDisable method, the call to removeButtonEvents should have been wrapped like so:
    PHP Code:
            if(this.renderFieldBtns){
                
    this.removeButtonEvents();
            } 
    Quote Originally Posted by radtad View Post
    form enabled (everything seems fine, but it won't do addItem)...
    Code:
    this.buttonClear is undefined
    this.buttonClear.addClassOnOver('x-superboxselect-btn-over')
    I can't re-create this - I've set disabled to false and used addItem without issues.

    If you are still having problems, please post a link to a working example, or copy and paste code that I can use to reproduce the error.

    Thanks again,

    Dan

  7. #47
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    Quote Originally Posted by radtad View Post
    Let's see if I can give you an example:

    I have a name "Chris" I'm trying to find because that's what he told me his name is. But his first name is actually "John" and his middle name is "Chris". So the display field would normally be {First Name} {Middle Name} {Last Name} i.e. "John Chris Doe". With no mid-word pattern matching available, if I didn't know Chris' real name was John, I'd never get his name as a return match.


    A big use case for our company comes down to email addresses. Currently I have "Tad Johnston (rad)" as the display field, "rad" being the email address. A lot of people here often times do not know the person's actual name, but they always know their email address because it's something they see often. Now, if I don't have mid-word pattern matching I can never find "rad".

    Another suggestion which would be even better would be matching on more then just the displayField, possibly in the store. Then I wouldn't have to worry about mid word pattern matching whatsoever.

    Hope this makes sense....
    Thanks, It makes sense - I think matching against all store fields would be the best way - I'll see what the effort would be and add it to the list of nice to have's.

  8. #48
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    Quote Originally Posted by mjlecomte View Post
    I haven't tested / tried this ux, but you may be interested in this thread:
    http://extjs.com/forum/showthread.ph...650#post337650
    Thanks for the link Michael, I couldn't reproduce the issue myself - I think it's fixed with the current SVN codebase..

  9. #49
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
    radtad is on a distinguished road

      0  

    Default


    Quote Originally Posted by danh2000 View Post
    Thanks, It makes sense - I think matching against all store fields would be the best way - I'll see what the effort would be and add it to the list of nice to have's.
    I just added a bit of code to do mid-word pattern matching for the SuperBoxSelect from the previous facebook like box select I added there as well (you essentially have to override doQuery):

    Code:
        anyMatch: true,
        caseSensitive: false,
        createValueMatcher: function(value) {
            console.log('createValueMatcher...'+value);
            if (Ext.isEmpty(value, false)) {
                return new RegExp('^');
            }
            value = Ext.escapeRe(String(value));
            return new RegExp((this.anyMatch === true ? '' : '^') + '(' + Ext.escapeRe(value) + ')', this.caseSensitive ? '' : 'i');
        },
        prepareData : function(data) {
            var result = Ext.apply({}, data);
            result[this.displayField] = data[this.displayField].replace(this.createValueMatcher(this.getRawValue()), function(a, b){
                if (typeof b != 'string') {
                    return '';
                }
                return '<span class="ext-combo-match">' + b + '</span>';
            });
            return result;
        },
    
        initList : function() {
                Ext.ux.form.SuperBoxSelect.superclass.initList.apply(this, arguments);
                this.view.prepareData = this.prepareData.createDelegate(this);
        },
    
        doQuery : function(q, forceAll) {
                if(q === undefined || q === null) {
                    q = '';
                }
                var qe = {
                    query: q,
                    forceAll: forceAll,
                    combo: this,
                    key: ";"
                };
                if (this.fireEvent('beforequery', qe)===false || qe.cancel) {
                    return false;
                }
                q = qe.query;
                forceAll = qe.forceAll;
                if (forceAll === true || (q.length >= this.minChars)) {
                    if(this.lastQuery !== q){
                        this.lastQuery = q;
                        if(this.mode == 'local'){
                            this.selectedIndex = -1;
                            if(forceAll){
                                this.store.clearFilter();
                            } else {
                                this.store.filter(this.displayField, q, this.anyMatch);
                            }
                            this.onLoad();
                        } else {
                            this.store.baseParams[this.queryParam] = q;
                            this.store.load({
                                params: this.getParams(q)
                            });
                            this.expand();
                        }
                    } else {
                        this.selectedIndex = -1;
                        this.onLoad();
                    }
                }
            },
    By the way, thanks for the quick response and nice work on the box! Much faster and cleaner than the original.

  10. #50
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    @radtad,

    Nice - why don't you make it a standalone plugin, that way you could plug the functionality into SuperBoxSelect, or ComboBox or any component that extends ComboBox.

Thread Participants: 119

  1. galdaka (9 Posts)
  2. aconran (1 Post)
  3. stever (4 Posts)
  4. dj (1 Post)
  5. mystix (18 Posts)
  6. MarkB (3 Posts)
  7. DrZog (1 Post)
  8. JorisA (2 Posts)
  9. jheid (3 Posts)
  10. Joe (1 Post)
  11. mschering (1 Post)
  12. gigel (1 Post)
  13. akannu (1 Post)
  14. phillipL (1 Post)
  15. badgerd (1 Post)
  16. cmendez21 (1 Post)
  17. mjlecomte (1 Post)
  18. grgur (1 Post)
  19. xantus (1 Post)
  20. garraS (3 Posts)
  21. vahid4134 (2 Posts)
  22. Lloyd K (2 Posts)
  23. boonkerz (3 Posts)
  24. crxtech (3 Posts)
  25. mishanian (7 Posts)
  26. fpw23 (1 Post)
  27. sanjshah (6 Posts)
  28. Zolcsi (1 Post)
  29. SharePat (1 Post)
  30. mjhaston (1 Post)
  31. radtad (16 Posts)
  32. Joyfulbob (2 Posts)
  33. kveeiv (1 Post)
  34. armandoxxx (2 Posts)
  35. imran (1 Post)
  36. Eric24 (1 Post)
  37. drunknmunky (1 Post)
  38. raphac (1 Post)
  39. charleshimmer (1 Post)
  40. frankthetank (4 Posts)
  41. qooleot (3 Posts)
  42. gianpaulo (1 Post)
  43. dennispg (9 Posts)
  44. dasnk (1 Post)
  45. grahamda (1 Post)
  46. sdavids (1 Post)
  47. jasonb885 (1 Post)
  48. wemerson.januario (1 Post)
  49. dizor (3 Posts)
  50. Stju (5 Posts)
  51. extjs_new (1 Post)
  52. senacle (1 Post)
  53. elderotaku (2 Posts)
  54. Dumas (1 Post)
  55. grzegorz.borkowski (13 Posts)
  56. bueth (1 Post)
  57. nonyus (2 Posts)
  58. travisbell (2 Posts)
  59. Jangla (2 Posts)
  60. woooop (2 Posts)
  61. MH61 (2 Posts)
  62. TDub (1 Post)
  63. antoniode (5 Posts)
  64. xiongzhijian51 (1 Post)
  65. l0ga4 (1 Post)
  66. nohurge (2 Posts)
  67. MarkBOneSmart (1 Post)
  68. The Transporter (2 Posts)
  69. swarnendude (1 Post)
  70. arconen (2 Posts)
  71. mratzloff (9 Posts)
  72. Tom23 (1 Post)
  73. nadim (15 Posts)
  74. hongtj (2 Posts)
  75. max.hauser (2 Posts)
  76. dcw (1 Post)
  77. pilotsnipes (2 Posts)
  78. matthewcrist (2 Posts)
  79. fargs (1 Post)
  80. dvuja2 (2 Posts)
  81. sudhirhv (1 Post)
  82. lanhun (2 Posts)
  83. galoch (1 Post)
  84. frrogoy (1 Post)
  85. tboswell (1 Post)
  86. ozum (5 Posts)
  87. scusyxx (1 Post)
  88. hoca (1 Post)
  89. jayasreepc (1 Post)
  90. Jensen (1 Post)
  91. icarey (5 Posts)
  92. mohan_b (1 Post)
  93. skbach_pointyhat (1 Post)
  94. timbonicus (3 Posts)
  95. rachid.abdessamad (1 Post)
  96. ajitmogra (1 Post)
  97. Korbin (1 Post)
  98. istetska (3 Posts)
  99. ian.young (1 Post)
  100. muncher (2 Posts)
  101. sebterzi (2 Posts)
  102. forestclown (1 Post)
  103. Akey (1 Post)
  104. pret (1 Post)
  105. OpnSrce (1 Post)
  106. sriramkumarp (1 Post)
  107. extjs-dev (4 Posts)
  108. mvoss (1 Post)
  109. thomaskee007 (1 Post)
  110. rajshinny (1 Post)
  111. masood (1 Post)
  112. sebholl (1 Post)
  113. forestkwan (1 Post)
  114. deepthi_r (1 Post)
  115. panshr (1 Post)
  116. brian.moeskau (1 Post)
  117. ldashevskiy (1 Post)
  118. lbilde (1 Post)
  119. aoyii (1 Post)

Tags for this Thread