1. #41
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    13
    Vote Rating
    0
    Shn is on a distinguished road

      0  

    Default


    Hi,

    I'll probably be using your extension in basic forms. I was wondering it there's a reason why you don't use the default combo classes "x-combo-list", "x-combo-list-inner", "x-combo-selected". As I use the gray theme, I noticed that by using those classes along with "x-checkboxcombo-list" and "x-checkboxcombo-list-inner" and getting rid of all the colored stuff in the css file, it looked like a normal extjs combo.

    I might be creating selectAll() and selectNone() methods for it as well, but my knowledge of ExtJS isn't that great, so I'm not sure if it's a good idea that I share my perhaps-crappy code

    Oh and is there a reason why we should use your extension instead of Saki's LOVCombo ? I know they work differently, as stated in your first post, but I'm still wondering if I should use yours or his...

  2. #42
    Ext User
    Join Date
    Jun 2008
    Posts
    43
    Vote Rating
    0
    fulfowi is on a distinguished road

      0  

    Default


    Quote Originally Posted by cnelissen View Post
    Try adding triggerAction: 'all' to the config. This will force a reload of the data every time the trigger is clicked.
    Clint,

    I have a similar problem to Abhinandan's. However, I don't change the store, I just change the value of one checkboxcombo and set the same value for another checkboxcombo. I get variable behavior. Sometimes the value changes in the second combo and sometimes it doesn't. Sometimes the original values in the second combo remain checked and the new values are become checked. This happens whether or not the checkcombobox is a grid editor. I tried a clearValue() before the setValue(), but that didn't do anything. I tried your triggerAction suggestion, and I got a:

    this.proxy is undefined
    in FireBug. Also, I'm using the on 'collapse' event for the first combo to change the value for the second. Is this correct? I'd send a code snippet, but the code is on a classified machine which complicates matters. However, I can try to put something together if necessary.
    Doug

  3. #43
    Ext User
    Join Date
    Jun 2008
    Posts
    43
    Vote Rating
    0
    fulfowi is on a distinguished road

      0  

    Default


    Quote Originally Posted by fulfowi View Post
    Clint,

    I have a similar problem to Abhinandan's. ....
    Tried fargs solution in post #3 (separate setting of value and check values) and it fixed my problem. Will this be included in future releases?
    Doug

  4. #44
    Ext User
    Join Date
    Jun 2008
    Posts
    43
    Vote Rating
    0
    fulfowi is on a distinguished road

      0  

    Default


    Quote Originally Posted by cnelissen View Post
    This is currently not supported. I'll have to add some event listeners on the checkbox group and bubble them up to the triggerfield. I'll try to include this in the next release.
    Clint,

    When do you think this capability will be out? I want to implement All and None checkboxes, which will uncheck all other check boxes.

    BTW - I'm with the consensus. This is a very useful extension.

    Thanks,
    Doug

  5. #45
    Ext JS Premium Member cnelissen's Avatar
    Join Date
    Sep 2007
    Location
    California
    Posts
    224
    Vote Rating
    8
    cnelissen will become famous soon enough

      0  

    Default


    Quote Originally Posted by fulfowi View Post
    When do you think this capability will be out?
    I've been out of the office on business so I haven't had much time to devote to this, but I should have some time during the week. I'll make the necessary changes as soon as possible.
    - Clint Nelissen

  6. #46
    Sencha User FabriceTerrasson's Avatar
    Join Date
    Mar 2009
    Location
    fr
    Posts
    8
    Vote Rating
    0
    FabriceTerrasson is on a distinguished road

      0  

    Default


    Hi thank you for this plugin

    tried(without success) a un|check all toggle into a tbar like :
    Code:
                    ,{ text : '[un]check all.', tooltip: 'Toggle [un]check all',
                        enableToggle: true,
                        toggleHandler: function(btn, pressed) {
                            var combocbgroup= Ext.getCmp('tlds_update_id').cbgroup;                        
                            combocbgroup.items.each(function(cb){
                               if (pressed) {
                                   cb.wrap.addClass('x-form-check-checked');
                               } else {
                                   cb.wrap.removeClass('x-form-check-checked');
                               }
                               cb.wrap.repaint();
                               cb.checked= pressed;
                               });
                      }
    Any clue ?

  7. #47
    Ext JS Premium Member cnelissen's Avatar
    Join Date
    Sep 2007
    Location
    California
    Posts
    224
    Vote Rating
    8
    cnelissen will become famous soon enough

      0  

    Default


    Something like this would probably work better:

    Code:
    ,{ text : '[un]check all.', tooltip: 'Toggle [un]check all',
                        enableToggle: true,
                        toggleHandler: function(btn, pressed) {
                            var combocbgroup= Ext.getCmp('tlds_update_id').cbgroup;                        
                            combocbgroup.items.each(function(cb){
                               // Set the checkbox to false by default
                               cb.setValue(false);
    
                               // Then set the new state of the checkbox
                               cb.setValue(pressed);
                               });
                      }
    - Clint Nelissen

  8. #48
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    13
    Vote Rating
    0
    Shn is on a distinguished road

      0  

    Default


    Hi,

    As I'm planning on using some (un)selectAll() methods, I was wondering if it's normal that I don't have access to "cbgroup" until I click on the trigger and display the combo's content. I use a jsonstore with an url and autoLoad:true and I actually need to check all the checkboxes after the store is loaded...

    So, if you have any idea how to do that, it'd help alot

  9. #49
    Ext JS Premium Member cnelissen's Avatar
    Join Date
    Sep 2007
    Location
    California
    Posts
    224
    Vote Rating
    8
    cnelissen will become famous soon enough

      0  

    Default


    When the checkboxes are added to the cbgroup, they are looking for a 'checked' property on the record from the store to set their initial value. If you wanted them all checked by default, you could just loop through all your store records, and set checked = true. Something like:

    Code:
    yourJsonStore.on('load', function(store) {
         Ext.each(store.data.items, function(rec) {
    	store.getAt(rec.id).checked = true;
         });
    });
    * Not tested
    - Clint Nelissen

  10. #50
    Ext JS Premium Member
    Join Date
    Mar 2010
    Posts
    32
    Vote Rating
    0
    mrusinak is on a distinguished road

      0  

    Default


    Hello, nice extension! A functionality I desired was for the display area to update as selected items changed, and not just when collapsed. If anyone else is interested, my quick little change is:
    Code:
    ...
        // private
        onListClick: function(e, t) {
            if (Ext.get(e.getTarget()).dom.tagName != 'INPUT' && Ext.get(e.getTarget()).dom.tagName != 'LABEL') {
                var target = e.getTarget('div.x-form-item');
                if (target) {
                    target = Ext.get(target);
                    var cb = target.child('input');
                    cb = Ext.getCmp(cb.id);
                    cb.setValue(cb.getValue() ? false : true);
    
                }
            }
            if (this.updateOnChange) {
                this.assertValue();
            }
        },
        
        // private
        onListEnter: function(e, t) {
            var target = Ext.DomQuery.selectNode('.x-checkboxcombo-item-over', this.list.dom);
            if (target) {
                target = Ext.get(target);
                var cb = target.child('input');
                cb = Ext.getCmp(cb.id);
                cb.setValue(cb.getValue() ? false : true);
                
                if (this.updateOnChange) {
                    this.assertValue();
                }
            }
        },
    ...
    Which just adds the assertValue() call after using the Enter key or the mouse to check/uncheck an item, if you set "updateOnChange" to a truthy value in configuration.