Results 1 to 2 of 2

Thread: Uprading DataView to new Touch 2.1 List

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    17
    Vote Rating
    1
      0  

    Default Uprading DataView to new Touch 2.1 List

    Hi,

    i`m trying to upgrade my DataView to the new Sencha Touch 2.1 List.
    In my old DataItem i had 2 components. One indicating some Statusinfo and the other displaying Model information using a Ext.Label. The label uses a XTemplate.
    The updateRecord Method was overriden to apply Model Data to the Label.
    In 2.0 this was working very well. But now i upraded to Touch 2.1, extended my List from the new Ext.List and also changed from DataItem to ListItem.
    After doing so almost nothing works anymore! Not only is my custom styling totally messed up (i think i can fix this), but even worse, it seems that there is no itemtap event triggered anymore!
    Does anyone experiencing similar issues?

    My old DataItem`s config basically looked like this:

    config: {
    status: {
    cls:'status'
    },

    label: {
    cls:'short',
    flex:1,
    tpl: new Ext.XTemplate('...some templating with conditions and a member function...')
    },

    layout: {
    type: 'hbox'
    }
    },

    updateRecord: function(record) {
    this.callParent([record]);
    this.getLabel().updateRecord(record);
    },



    applyStatus: function() {
    return Ext.factory(config, Ext.Component, this.getStatus());
    },

    applyLabel: function() {
    return return Ext.factory(config, Ext.Component, this.getLabel());
    },

    updateStatus: function(newStatus, oldStatus)
    {
    if(oldStatus) {
    this.remove(oldStatus);
    }

    if(newStatus) {
    this.insert(1, newStatus);
    }
    },

    updateLabel: function(newLabel, oldLabel)
    {
    if(oldLabel) {
    this.remove(oldLabel);
    }

    if(newLabel) {
    this.insert(2, newLabel);
    }
    }

    So my biggest issue is not getting itemtap events anymore.

    Do i have to add my Components to the new body?
    Is there a way to just use my template in body? I`ve tried adding my existing template to the body config, but nothing happend...


    Any help appreciated!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    A simple list with listitem is firing the itemtap for me.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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