1. #1
    Ext User
    Join Date
    Oct 2007
    Location
    Hungary
    Posts
    136
    Vote Rating
    0
    slobo is on a distinguished road

      0  

    Default [FIXED][2.x] DataView tpl config option bug

    the DataView's tpl config option
    does not accept an array of strings (HTML fragments)
    as stated in the docs
    (can only accept a string or an XTemplate - this can also clearly be seen from the source code of DataView)

    (I think this should be handled as a programming bug, not as a docs problem)

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,485
    Vote Rating
    135
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default

    slobo -

    Thanks for the bug report. We've added this into our issue tracker and will take a look at it.

    Thanks,
    Aaron Conran
    @aconran

  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

    this bug's still present in 2.2.

    bugfix for this is trivial:
    Code:
    Ext.override(Ext.DataView, {
        // private
        initComponent : function() {
            Ext.DataView.superclass.initComponent.call(this);
            if (typeof this.tpl == "string" || Ext.type(this.tpl) == "array") {
                this.tpl = new Ext.XTemplate(this.tpl);
            }
    
            this.addEvents(
                "beforeclick",
                "click",
                "mouseenter",
                "mouseleave",
                "containerclick",
                "dblclick",
                "contextmenu",
                "selectionchange",
                "beforeselect"
            );
    
            this.all = new Ext.CompositeElementLite();
            this.selected = new Ext.CompositeElementLite();
        }
    });

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    104
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default

    Maybe, instead, we should check if it is not a usable template class:

    Code:
    Ext.override(Ext.DataView, {
    	initComponent : function(){
    		Ext.DataView.superclass.initComponent.call(this);
    		if(this.tpl && !this.tpl.overwrite){
    			this.tpl = new Ext.XTemplate(this.tpl);
    		}
    		this.addEvents(
    			"beforeclick",
    			"click",
    			"mouseenter",
    			"mouseleave",
    			"containerclick",
    			"dblclick",
    			"contextmenu",
    			"selectionchange",
    			"beforeselect"
    		);
    		this.all = new Ext.CompositeElementLite();
    		this.selected = new Ext.CompositeElementLite();
    	}
    });

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,603
    Vote Rating
    753
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default

    Fixed in SVN.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!