1. #71
    Sencha User
    Join Date
    May 2010
    Posts
    28
    Vote Rating
    0
    sankarbaluz is on a distinguished road

      0  

    Exclamation Setting Multiple Values Issue

    Setting Multiple Values Issue


    Hi,
    While trying to set more than 3 values in BoxSelect,its not showing anything I am sending you with a simple example.

    Code:
    var basicBoxselect = Ext.create('Ext.ux.form.field.BoxSelect', {
            fieldLabel: 'Select multiple states',
            renderTo: 'basicBoxselect',
            displayField: 'name',
            width: 500,
            labelWidth: 130,
            store: statesStore,
            queryMode: 'local',
    		emptyText: 'Pick a state, any state',
    		valueField: 'abbr',
    		value: 'WA, TX,SD,TN'
        });
    but the code is working fine for

    Code:
    var basicBoxselect = Ext.create('Ext.ux.form.field.BoxSelect', {
            fieldLabel: 'Select multiple states',
            renderTo: 'basicBoxselect',
            displayField: 'name',
            width: 500,
            labelWidth: 130,
            store: statesStore,
            queryMode: 'local',
    		emptyText: 'Pick a state, any state',
    		valueField: 'abbr',
    		value: 'WA, TX'
        });
    Please tell me how to setValue for the BoxSelect for multiple items.I given something like this
    Code:
    basicBoxselect.setValue('IMDG,BC,BHH,JJJ');
    its not working...if i will set values for 2 items,it will work...

  2. #72
    Sencha Premium Member
    Join Date
    May 2007
    Location
    USA
    Posts
    73
    Vote Rating
    0
    notjoshing is on a distinguished road

      0  

    Default


    Quote Originally Posted by sankarbaluz View Post
    Hi,
    While trying to set more than 3 values in BoxSelect,its not showing anything I am sending you with a simple example.
    You're using different delimiters for the items. In the two value example, your delimiter is a comma followed by a space. Your multiple value examples use only a comma. Whatever your delimiter is (you can specify it with the 'delimiter' parameter), you need to match it exactly for your values to work.

    Josh
    Using:
    ExtJS 2.2, 3.2, 4.0.7a
    WinXP SP3
    FF10,6; IE6; IE8; Safari

  3. #73
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    92
    Vote Rating
    1
    kveeiv is on a distinguished road

      0  

    Exclamation 1.3 Released

    1.3 Released


    1.3 has been released and the first post has been updated. Please see that post for a more complete list of updates.

    My continued thanks go out to the various testing and coding contributions that have been made so far from the community for this extension, and also for the thousands upon thousands of thread views and downloads.

    Quote Originally Posted by ngd View Post
    Bug 1) I have tried your fix and unfortunately BoxSelect just stops working. I am not even able to select values into it.
    My apologies for the problems with the previous release introduced by auto-querying. I have been very busy lately and unfortunately have not been able to get this update out more quickly. Thank you for your understanding and taking the time to file these bug reports. The underlying issue for this has been fixed in 1.3.

    Quote Originally Posted by ngd View Post
    Bug 2) If I use a remote store, and if I set multiSelect to false, the Name corresponding to the value field does not show up in the box. If I set multiSelect to true, it shows up.
    This has been resolved.

    Quote Originally Posted by ngd View Post
    Bug 3) If I set the value to be a CSV e.g. '123, 456' or if I set it to an array, BoxSelect sends me the inital query infinite times. It just doesn't stop.
    This has been resolved and also an example of remote querying has been added to the documentation to make sure this functionality remains tested in the future and to provide a demonstration for those wishing to leverage this functionality.

    Quote Originally Posted by notjoshing View Post
    I'd get errors when I clicked on a newly rendered BoxSelect without a value. To avoid this, I modified the code around 433:

    ...

    I also noticed that the emptyText value was rendering even when values existed for the drop-downs. I looked into the code and changed the code around line 1030 to prevent this:

    ...
    Thanks for the contributions! They have been included in 1.3.

  4. #74
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    45
    Vote Rating
    3
    charlie17 is on a distinguished road

      0  

    Default


    Thanks for the updates kveeiv.

    I am seeing an issue in 1.3 that was not present in the previous version: When I start typing an entry, as soon as the filtered list of choices appears, the text I've typed gets cleared out of the text box area. It just gets totally blanked out. This pretty much negates the ability to type in a value and hurts my usability quite a bit.

    This is running 4.0.7 and using a remote store.

    In brighter news, the infinite looping issue is definitely fixed.

    Any ideas?

  5. #75
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    92
    Vote Rating
    1
    kveeiv is on a distinguished road

      0  

    Default


    1.3.1 has been released and the first post has been updated. Please see that post for a more complete list of updates.

    Quote Originally Posted by charlie17 View Post
    I am seeing an issue in 1.3 that was not present in the previous version: When I start typing an entry, as soon as the filtered list of choices appears, the text I've typed gets cleared out of the text box area.
    This was mistakenly introduced in 1.3.1 and I had overlooked testing the remote store querying. I have modified the server side script included in the remote store example to handle querying, and have fixed the over-zealous clearing of the input field.

    Quote Originally Posted by sankarbaluz View Post
    Could I understand that how we are giving "displayFieldTpl"?
    I have added the capability to customize the label template to 1.3.1. The remote store example now shows how to do this. The "tpl" config property is used by ComboBox to create the picker, and a "labelTpl" config property has been added to BoxSelect 1.3.1 to control the rendering of the labeled items. The defaults for these remain as being built off of the combo's displayField config property.

  6. #76
    Ext JS Premium Member
    Join Date
    Oct 2011
    Location
    Brussels
    Posts
    10
    Vote Rating
    0
    nikadod is on a distinguished road

      0  

    Default Numeric values issue

    Numeric values issue


    I am using BoxSelect with Store which is bound to a following Model:

    Code:
    Ext.define('App.model.MyModel', {
        extend: 'Ext.data.Model',
        fields: [
            {name: 'record_id', type: 'int'}, 
            'name'     
        ],
        proxy: {
            type: 'ajax',
            url: 'myModel.cfm',
            reader: {
                type: 'json'
            }
        }
    });
    Delimiter of BoxSelect is set to comma (,), and multiSelect is true by default.

    I noticed that if I call boxselect.setValue(1) it works fine.
    But once I say boxselect.setValue("1,2") it simply does not set anything.

    After a bit of investigation I believe I see the problem. BoxSelect is using its own method findRecord to search for the record in the bound store.
    Code:
        findRecord: function(field, value) {
            var ds = this.store,
            rec = false,
            idx;
    
    
            if (ds.snapshot) {
                idx = ds.snapshot.findIndexBy(function(rec) {
                    return rec.get(field) === value;
                });
                rec = (idx !== -1) ? ds.snapshot.getAt(idx) : false;
            } else {
                idx = ds.findExact(field, value);
                rec = (idx !== -1) ? ds.getAt(idx) : false;
            }
    
    
            return rec;
        },
    As you see it uses strict comparison.
    However, when string like "1,2" is split into array (inside setValue), the resulting array contains string elements:
    ["1", "2"].

    I changed comparison in findRecord to type-converting (just removed one =), and think it may be included as a fix in next releases.

  7. #77
    Ext JS Premium Member
    Join Date
    May 2008
    Location
    Austria, Vienna
    Posts
    213
    Vote Rating
    1
    abraxxa is on a distinguished road

      0  

    Default


    I'd rather keep the not-type-converting comparison operator and fix the code that puts strings rather than numbers into the array.

  8. #78
    Ext JS Premium Member
    Join Date
    Oct 2011
    Location
    Brussels
    Posts
    10
    Vote Rating
    0
    nikadod is on a distinguished road

      0  

    Default


    Quote Originally Posted by abraxxa View Post
    I'd rather keep the not-type-converting comparison operator and fix the code that puts strings rather than numbers into the array.
    I agree with this. However, after looking on implementation of Ext.data.Store.findExact (which is used as an alternative way of getting record in the code of BoxSelect.findRecord) I decided to go for the same way of comparison, to be consistent.

  9. #79
    Ext JS Premium Member
    Join Date
    Oct 2011
    Location
    Brussels
    Posts
    10
    Vote Rating
    0
    nikadod is on a distinguished road

      0  

    Default


    Quote Originally Posted by nikadod View Post
    I agree with this. However, after looking on implementation of Ext.data.Store.findExact (which is used as an alternative way of getting record in the code of BoxSelect.findRecord) I decided to go for the same way of comparison, to be consistent.
    Further observation on Ext.data.Store.findExact implementation. It had non-type-converting comparison in Ext 4.0.6, and was changed to type-converting comparison in Ext 4.0.7.
    My proposal seems to be consistent with Store's findExact behavior in 4.0.7, but not in 4.0.6.

  10. #80
    Sencha User
    Join Date
    Mar 2010
    Posts
    51
    Vote Rating
    2
    koblass is on a distinguished road

      0  

    Default Remove values from the list when added...

    Remove values from the list when added...


    Hi,

    Nice to see this component evolving.
    Would it be possible to have an option that removed the item from the list as soon this one has been selected ?

    Best regards
    Daniel

Thread Participants: 93

  1. scottw (1 Post)
  2. mysticav (2 Posts)
  3. JorisA (5 Posts)
  4. bobmanc (2 Posts)
  5. notjoshing (4 Posts)
  6. grgur (1 Post)
  7. ValterBorges (2 Posts)
  8. WebProgrammer (1 Post)
  9. Schlurcher (1 Post)
  10. zacware (2 Posts)
  11. ngd (8 Posts)
  12. radtad (2 Posts)
  13. zombeerose (13 Posts)
  14. nicholasnet (1 Post)
  15. themightychris (2 Posts)
  16. abraxxa (8 Posts)
  17. ttbgwt (1 Post)
  18. Psychokrameur (2 Posts)
  19. commanche (1 Post)
  20. ernst96 (2 Posts)
  21. omarc (1 Post)
  22. qooleot (1 Post)
  23. foxmarco (1 Post)
  24. christophe.geiser (1 Post)
  25. wki01 (1 Post)
  26. purnama (1 Post)
  27. mediacept (1 Post)
  28. bareflix (2 Posts)
  29. User 0815 (1 Post)
  30. yuuzai (1 Post)
  31. talha06 (1 Post)
  32. xjpmauricio (1 Post)
  33. scishop (2 Posts)
  34. Smalltalker (1 Post)
  35. hazimdikenli (2 Posts)
  36. raz0r1 (1 Post)
  37. McQuack_82 (1 Post)
  38. elilindner (1 Post)
  39. hexawing (1 Post)
  40. maneljn (3 Posts)
  41. Tim Toady (2 Posts)
  42. alonweiss (1 Post)
  43. ubong (1 Post)
  44. salarmehr (5 Posts)
  45. koblass (1 Post)
  46. Karthikeyan.rajmohan (2 Posts)
  47. Reimius (1 Post)
  48. CSC-Germany (1 Post)
  49. sankarbaluz (2 Posts)
  50. alaley (2 Posts)
  51. navvn (2 Posts)
  52. danCTS (2 Posts)
  53. bentoo42 (1 Post)
  54. jmaia (2 Posts)
  55. maslofer (1 Post)
  56. cadror (3 Posts)
  57. mrinsan (1 Post)
  58. yumaa (1 Post)
  59. rsqw (2 Posts)
  60. mahesh21688 (3 Posts)
  61. derditze (3 Posts)
  62. kunalshah6363 (1 Post)
  63. NatVik (1 Post)
  64. softwareguy (1 Post)
  65. alicexyl (7 Posts)
  66. under_dog (1 Post)
  67. tommytob (2 Posts)
  68. charlie17 (5 Posts)
  69. nathanrice (1 Post)
  70. srarnold (3 Posts)
  71. ettavolt (1 Post)
  72. qnens (1 Post)
  73. nikadod (3 Posts)
  74. PanchiKB (1 Post)
  75. Hooped (1 Post)
  76. dedoz (3 Posts)
  77. metas (1 Post)
  78. lindemann-medien (2 Posts)
  79. nathanmelis (1 Post)
  80. cyborat (1 Post)
  81. Forn (1 Post)
  82. gaurav.rehan (1 Post)
  83. Avman2119 (3 Posts)
  84. zzhouag (5 Posts)
  85. andreas-spindler (3 Posts)
  86. Alvaro L (1 Post)
  87. hown (1 Post)
  88. edson.hh (2 Posts)
  89. QuantumScripting (1 Post)
  90. chungns (1 Post)
  91. Delphine (1 Post)
  92. folivieri (1 Post)
  93. Lpsmash (1 Post)

Tags for this Thread