This duplicates another bug already reported in our system: DSGNR-1482
  1. #1
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    231
    Vote Rating
    6
    bseddon is on a distinguished road

      0  

    Default renderTpl in Ext.applyIf()

    renderTpl in Ext.applyIf()


    I'm posting the issue in this forum because although the problem may be the work of ExtJS the problem shows itself using the designer.

    If I want to create a component in the designer I am able to specify the html to render using the renderTpl config property. However the designer assigns the template html to the renderTpl property in an Ext.applyIf() function. For example:

    Code:
    Ext.applyIf(me, {
    renderTpl: [ '<h1>My component</h1>' ]
    });
    The problem is that renderTpl has been set to 'null' by ExtJS so this function will never assign the template to the renderTpl property because it is not undefined. Outside the designer I can implement a clumsy workaround by assigning executing the follwing line before the Ext.applyIf() function is called:

    Code:
    me.renderTpl = undefined;
    Here's a link to a JSFiddle which provide some sample code and shows the problem:

    http://jsfiddle.net/bseddon/qDjLf/2/

    The example shows the implementation of a simple component which renders its content using a template renderTpl. The component is added to a panel twice. Once using applyIf() which fails. Once using apply() which works just fine.

    Questions: Am I missing something? Is there a better workaround? Is there flag in the designer to instruct it to use Ext.apply() in preference to Ext.applyIf() or added the value to the config list outside initComponent()? Is this an ExtJS problem?

  2. #2
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    231
    Vote Rating
    6
    bseddon is on a distinguished road

      0  

    Default


    Same problem affects 'childEls' also.

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,889
    Vote Rating
    102
    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


    Sounds like an inconsistency in Ext JS that we should be addressing in Sencha Designer.

    We'll take a look at it.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    1
    Vote Rating
    0
    kylehumfeld is on a distinguished road

      0  

    Default Any further word on this?

    Any further word on this?


    I'm having the same problem. I've tried all manner of different strings, attempts at objects, and so on, but literally nothing works. If you've solved this and just not updated this thread, I'd appreciate an example of literally any string I can put in the renderTpl property that will not crash the entire page.

  5. #5
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,737
    Vote Rating
    51
    Phil.Strong is a jewel in the rough Phil.Strong is a jewel in the rough Phil.Strong is a jewel in the rough Phil.Strong is a jewel in the rough

      0  

    Default


    Can you give us examples of what you're trying?

    In general using renderTpl is an extreme measure that's typically not needed. Are you using the box component?
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    231
    Vote Rating
    6
    bseddon is on a distinguished road

      0  

    Default


    Phil

    The issue was found creating a lightbox component for use with ExtJS. As you know, lightboxes have a particular style so don't lend themselves to whatever is the current ExtJS style. A link to an example is available from my post (2nd last) in this thread:

    http://www.sencha.com/forum/showthre...xt.ux.Lightbox

    In this case using renderTpl is by far and away the easiest way to implement an ExtJS component.

    On line 345 of the example (gallery.html) there is a statement which is intended to workaround the problem:

    this.renderTpl = undefined;

    You will look at this an ask why is ApplyIf() being used on the next line. As you will see from the comments just above this statement, in this example I'm is simulating what goes on in Sencha Architect. In SA is not displayed in the designer because the code generated by SA is AppyIf() not Apply().

    On ExtJS initialization of a component it assigns:

    renderTpl = null;

    As a result ApplyIf() will not set renderTpl to anything else because ApplyIf() only applies config items to undefined properties. renderTpl is not 'undefined', its 'null'.

    In the example on the end of the link above setting renderTpl to undefined is easy. Within SA, not so much. In SA its necessary to create an override. As a result, SA is unable to generate the correct code nor is it able to display the component in the designer.

    It seem clear to me that renderTpl should not be set to null by ExtJS. If renderTpl is deprecated this should be noted more clearly in the documentation. If renderTpl is supposed to work, then it will be ideal that it does work.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar