1. #1
    Ext User andrei.neculau's Avatar
    Join Date
    Jul 2007
    Location
    Romania
    Posts
    196
    Vote Rating
    0
    andrei.neculau is on a distinguished road

      0  

    Lightbulb [already on its way] Ext.View - deselect

    [already on its way] Ext.View - deselect


    Proposal to add method deselect to Ext.View.

    My "hack" (a simple adaptation of select):
    Code:
    Ext.apply(Ext.View.prototype, {
        deselect:function(nodeInfo, suppressEvent){
                    if(nodeInfo instanceof Array){
                for(var i = 0, len = nodeInfo.length; i < len; i++){
                    this.deselect(nodeInfo[i], true);
                }
            } else{
                var node = this.getNode(nodeInfo);
                if(node && this.isSelected(node)){
                        Ext.fly(node).removeClass(this.selectedClass);
                        this.selections.remove(node);
                        if(!suppressEvent){
                            this.fireEvent("selectionchange", this, this.selections);
                        }
                }
            }
        }
    });

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

      0  

    Default


    think Animal already suggested something similar a month or 2 ago.

    try searching for "Ext.View unselect"

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,458
    Vote Rating
    20
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    There is a deselect in my DDView I think.

  4. #4
    Ext User andrei.neculau's Avatar
    Join Date
    Jul 2007
    Location
    Romania
    Posts
    196
    Vote Rating
    0
    andrei.neculau is on a distinguished road

      0  

    Default


    Very much true: http://extjs.com/forum/showthread.ph....view+unselect

    I just didn't think of unselect but deselect when searching on the forum.

  5. #5
    Ext User andrei.neculau's Avatar
    Join Date
    Jul 2007
    Location
    Romania
    Posts
    196
    Vote Rating
    0
    andrei.neculau is on a distinguished road

      0  

    Default


    Though... to be acting "to the letter of the law" , there is no unselect, but deselect

    http://dictionary.reference.com/browse/deselect - (verb) to remove from selection

    http://dictionary.reference.com/browse/unselect - (adj) not select, excellent or suitable