Hybrid View

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Answers
    10
    Vote Rating
    1
    umr.ashrf is on a distinguished road

      0  

    Default Unanswered: List with Other Controls

    Unanswered: List with Other Controls


    I tried to add a control (SelectField) into list items so every time list load records, that would have select field.

    Currently I am using following code on list Painted event.

    Code:
    this.theStore.each(function(record) {    
        var target = Ext.get("u-list-column-" + record.get('id'));
        
        Ext.create('Ext.field.Select', {
            cls : 'u-select',
            options : options,
            renderTo : target
        });
    });
    The above code works as expected but if the list has paging enabled the next loaded items don't get it because painted event is not fired and if it had fired, few list items would have more than one controls added whereas only one is needed. Is there a better way to do it in Sencha Touch 2 Beta version?

  2. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Answers
    148
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    With B1 the Sencha Team released Dataview components.
    You can find more info at the following link

    http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.component.DataItem

    Hope this helps.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Answers
    3447
    Vote Rating
    814
    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


    Check out the Kiva example for a DataView (useComponents) in action
    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.

  4. #4
    Sencha User
    Join Date
    Oct 2011
    Location
    Pakistan
    Posts
    229
    Answers
    10
    Vote Rating
    1
    umr.ashrf is on a distinguished road

      0  

    Default


    I tried this new feature, this is really good. Is that possible to put pinned headers at the top of each column in that DataView?

    And as this example goes.



    Code:
     dataMap: {      // When the record is updated, get the text configuration, and
          // call setHtml with the 'text' field of the record.
          getText: {
             setHtml: 'text'
         },
    
    
         // When the record is updated, get the userName configuration, and
         // call setHtml with the 'from_user' field of the record.
         getUserName: {
             setHtml: 'from_user'
         },
    
    
         // When the record is updated, get the avatar configuration, and
         // call `setSrc` with the 'profile_image_url' field of the record.
         getAvatar: {
             setSrc: 'profile_image_url'
         }
     },
    How can I concatenate data properties with custom string. Something like...

    Code:
    getPrice: {         setHtml: 'price' + ' USD'
         },