Results 1 to 5 of 5

Thread: [FIXED][2.x] DataView tpl config option bug

  1. #1
    Ext User
    Join Date
    Oct 2007
    Location
    Hungary
    Posts
    136
    Vote Rating
    0
      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,487
    Vote Rating
    146
      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 User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      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
    119
      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
    18,583
    Vote Rating
    873
      0  

    Default

    Fixed in SVN.
    Evan Trimboli
    Twitter - @evantrimboli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •