1. #1
    Ext User
    Join Date
    Jun 2007
    Posts
    16
    Vote Rating
    0
    pazx is on a distinguished road

      0  

    Question Incomplete feature or bug? Tree.MultiSelectionModel vs JsonView

    Incomplete feature or bug? Tree.MultiSelectionModel vs JsonView


    From MultiSelectionModel:
    Code:
    public function select( TreeNode node, [EventObject e], Boolean keepExisting )
    From JsonView:
    Code:
    select( Array/HTMLElement/String/Number nodeInfo, [Boolean keepExisting], [Boolean suppressEvent] )
    JsonView accepts an array of elements, yet MultiSelectionModel does not. Something this inconsistent seems near bug severity, no?

    It would make sense if MultiSelectionModel accommodated arrays of objects & arrays of strings with the node id.

    edit: suppressEvent is missing also, why so many inconsistencies?

  2. #2
    Ext User
    Join Date
    Jun 2007
    Posts
    16
    Vote Rating
    0
    pazx is on a distinguished road

      0  

    Default


    for anyone else who needs this fixed asap, something like this should work to extend tree.MultiSelectionModel so MultiSelectionModel.select() behaves more like jsonView.select():

    Code:
    Ext.override(Ext.tree.MultiSelectionModel, {
    
    	select : function(nodeInfo, e, keepExisting, suppressEvent){
    		if(!keepExisting)
    			this.clearSelections(true);
    	
    		if(nodeInfo instanceof Array)
    		{
    			for(var i = 0, len = nodeInfo.length; i < len; i++){ this.select(nodeInfo[i], e, true, true); }
    		}
    		else if (nodeInfo != null)
    		{
    			var node = this.getNode(nodeInfo);
    			
    			if(this.isSelected(node))
    			{
    				this.lastSelNode = node;
    				return node;
    			}
    			
    			this.selNodes.push(node);
    			this.selMap[node.id] = this.lastSelNode = node;
    			
    			node.ui.onSelectedChange(true);
    			
    			if(!suppressEvent)
    				this.fireEvent("selectionchange", this, this.selNodes);
    			
    			return node;
    	    }
    	},
    
    	getNode : function(nodeInfo){
    		if(typeof nodeInfo == "string"){
    			return  this.tree.getNodeById(nodeInfo);
    		}else if(typeof nodeInfo == "number"){
    			return this.tree.nodes[nodeInfo]; // probably doesnt work
    		}
    		return nodeInfo;
    	}
    
    });
    it might be nice if selectionchange could be fired on the last array element only?

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

      0  

    Default


    please refer to this thread before posting your next "bug".

  4. #4
    Ext User haibijon's Avatar
    Join Date
    Mar 2007
    Posts
    105
    Vote Rating
    0
    haibijon is on a distinguished road

      0  


    mystix, he didn't post a bug, he pointed out api inconsistancy as well as a possible workaround to get to the desired behaviour. If this were the bug forum, and he was actually posting a bug, or just complaining I'd agree with you. He didn't say it was a bug, merely asked the question if it was one. I don't see the reason for reacting negatively, and not actually discussing what he brought up...

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

      0  

    Default


    hi haibijon,

    it was in the bug forum, so i moved the thread over to this forum (do a quick scan for this thread title in the bugs forum; you'll see it there).

    plus, i did mention in this thread that opinions / suggestions aren't bugs, and that they should go in either the General / Prerelease forums instead.

    hope this clears things up

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi