1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    498
    Answers
    25
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default Unanswered: DataView tpl config - why has this changed?

    Unanswered: DataView tpl config - why has this changed?


    In ST1 you could provide a template that runs on the store specified to the DataView. Now it appears that's just not possible. The docs say:

    "Note The data configuration must be set for any content to be shown in the component when using this configuration."

    But even if the data config is specified, the template still outputs nothing.

    My use case is I'm outputting a calendar view using an html table, so need to be able to start/end a <tr> tag every 7 elements. I can't do this using itemTpl as ST2 wants every itemTpl element to be valid HTML5 in isolation.

    So any idea how to get tpl working again in ST2?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,064
    Answers
    3498
    Vote Rating
    851
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    For Ext.dataview.DataView, you should use the itemTpl config, not tpl.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    498
    Answers
    25
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    I get that Mitchell, but in my use case of outputting a table, with a new tr every 7 items, it doesn't work because ST2 wants valid HTML out of every itemTpl instance, so for example this output from one iteration of the itemTpl for Monday's cell:

    Code:
    <tr>
    <td>item cell</td>
    doesn't work, because it's not valid (tr not closed - but it would eventually be closed on sunday's cell)

    See what I mean?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,064
    Answers
    3498
    Vote Rating
    851
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    DataView in ST2 is a lot different than in ST1. For instance DataView extends Container now so each row is an item whereas in ST1 it extended Component and just applied the html from the XTemplate + data to the html.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    498
    Answers
    25
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    That makes porting this app from sencha touch 1 a little ugly! Nevermind. Having to listen to updates to the store and manually updating via an xtemplate using data grabbed from the store.

Thread Participants: 1