Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1206 in a recent build.
  1. #1
    Sencha - Support Team keckeroo's Avatar
    Join Date
    Mar 2008
    Location
    Winnipeg, Canada
    Posts
    289
    Vote Rating
    6
    keckeroo is on a distinguished road

      0  

    Default Dataview itemtpl vs tpl

    Dataview itemtpl vs tpl


    Apparently tpl is no longer functioning in Dataviews the way they used to be (ie accessing the configured store), and we now must use itemTpl and forego the 'itemSelector' configuration to tell us what triggers an item select.

    So - the question is ... how do I achieve the same looping mechanism in a dataview now ?

    I have data which I have to wrap in a table structure, and have each item as a cell in that table.

    This no longer works as far as I can tell. In fact - it seems rather silly that itemTpl can take a XTemplate which understands the <tpl for="."> mechanism since the Template is only performed on the single record.

    Suggestions ?

    Thank you!

    Kevin

    Code:
    tpl: new Ext.XTemplate(
       '<table border=0>',
       '<tr>',
       '<tpl for=".">',
       '<td>{random data from record here}</td>',
       '</tpl>',
       '</tr>',
       '</table>'
    )
    The above is what I need to get working again. It doesn't. Switching to itemTpl does - but of course, creates a table for each item. :-(

  2. #2
    Sencha User luismerino's Avatar
    Join Date
    Oct 2011
    Location
    Berlin
    Posts
    46
    Vote Rating
    4
    luismerino is on a distinguished road

      0  

    Default


    Hi. I'm not sure about the answer, although I've been asking myself the same question, but have you tried extending DataView instead of passing "tpl" as a configuration parameters?

    Code:
    Ext.define('MyDataView', {
       extend: 'Ext.DataView',
       config: {
          tpl: new Ext.XTemplate(...)
       }
    });
    Wonder if that works

  3. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    This looks like a bug. I'll add it as a ticket. Thanks.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    18
    Vote Rating
    2
    anj is on a distinguished road

      0  

    Default


    Same here, please provide this functionality back! Thanks!

  5. #5
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    So it seems this will not back it back into 2.0. This is because of the new structure of DataView and ComponentView, and all the complex dom structure that follows it.

    If you wish to do this manually, you will need to override getElementConfig in your subclass of DataView. The default is the following:

    Code:
    getElementConfig: function() {
        return {
            reference: 'element',
            className: 'x-container',
            children: [{
                reference: 'innerElement',
                className: 'x-inner'
            }]
        };
    }
    Here you can add any extra parent element you wish to add. Be aware though that this will not be direct parents of each item.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Location
    shanghai,china
    Posts
    28
    Vote Rating
    0
    xiuping is on a distinguished road

      0  

    Default


    how to add a parent element for the items? can you take an example? thank you very much

  7. #7
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    19
    Vote Rating
    1
    tdobberphul is on a distinguished road

      0  

    Default


    Hi all,
    I have the same problem in Touch 2.3.
    Can you provide an example, how I can achieve the formerly code:

    Code:
    tpl: [
                    '<svg id="mySVG" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 7900 600" currentScale="1">',
                    '    <g id="viewport">',
                    '        <tpl for=".">',
                    '            <polygon class="raum" points="{polygone}" />',
                    '        </tpl>',
                    '    </g>',
                    '</svg>'
                ]
    Thanks a lot.
    Tobias

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