1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Sallanches, France
    Posts
    371
    Vote Rating
    1
    myput is on a distinguished road

      0  

    Default display image in templates

    display image in templates


    Hello,

    I load a template by the way of a function in my globals.js:
    Code:
    function loadURL(url) {
    	var oRequest = new XMLHttpRequest();
    	oRequest.open('GET', url, false);
    	oRequest.setRequestHeader("User-Agent", navigator.userAgent);
    	oRequest.send(null);
    	
    	return oRequest.responseText;
    };
    and for exemple, in my view, i load this template:
    Code:
    tpl: loadURL(host + 'WPApp/app/views/ModuleDirectory/templates/DirectoryInformationsPanel.html'),
    In this template, i can access to all my store data, {name} etc ...
    But i have an Image link, in my store,
    and in the template DirectoryInformationsPanel.html, i load like that the image:
    Code:
    <img src={icon} title="thumb" style="float:right;">
    and it doesn't work.

    Before, i loaded the image directly in the view, by
    Code:
     tpl: '<img src={icon} title="thumb" style="float:right;"> '
    and it worked.

    How can i fixed it ?
    thanks for help

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Location
    Sallanches, France
    Posts
    371
    Vote Rating
    1
    myput is on a distinguished road

      0  

    Default


    I think the link is good because i have the little thumb: [?] image but i don't know how to do the link.
    It's maybe because i work in localhost ?

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Sallanches, France
    Posts
    371
    Vote Rating
    1
    myput is on a distinguished road

      0  

    Default


    That's strange,

    Display image by template work in a simple template in dataView, and in list too ...
    But Don't work in a nestedList ...
    Before template, i could display this one without template ...


    i checked some times my code and url in the browser give me the good image, then the link is good ...

    What is wrong with the code ? or it can be a bug ?

    Thanks for help