Hybrid View

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    4
    Vote Rating
    0
    Frewland is on a distinguished road

      0  

    Default Sencha Touch DataItem and DataView.useComponents incompatible with Architect 2.1

    Sencha Touch DataItem and DataView.useComponents incompatible with Architect 2.1


    I created a trivial ST2 app in Architect 2.1 using one DataView with useComponents : true

    Code:
    Ext.define('MyApp.view.MyDataView', {
        extend: 'Ext.dataview.DataView',
    
    
        config: {
            defaultType: 'mydataitem',
            store: 'MyDirectStore',
            useComponents: true,
            itemConfig: {
                xtype: 'mydataitem'
            }
        }
    
    
    });
    and linked it to a trivial DataItem

    Code:
    Ext.define('MyApp.view.MyDataItem', {
        extend: 'Ext.dataview.component.DataItem'
    
    
        config: {
            padding: 10,
            layout: {
                type: 'hbox'
            },
            items: [
                {
                    xtype: 'component',
                    flex: 1,
                    html: 'here'
                }
            ]
        },
    
    
        updateRecord: function(record) {
            // Provide an implementation to update this container's child items
        }
    
    
    });
    But I can only get this to work if I hand edit MyDataItem and put this line

    Code:
        xtype: 'mydataitem',
    in front of the config. Otherwise when I run it I get the error

    Uncaught Error: [ERROR][Ext.Container#setDefaultType] Invalid defaultType of: 'mydataitem', must be a valid component xtype

    Sencha Architect 2.1 won't let me put the xtype in. If I try it says

    A custom config cannot override a reserved config...

    However, if I hand edit the xtype property into MyDataItem, Sencha Architect removes whenever I save the project.

    What should I do ?

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Change it via an override.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Btw, we have a tutorial/guide coming on how to use the useComponents flag with Architect as many people have been asking.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Sep 2012
    Posts
    4
    Vote Rating
    0
    Frewland is on a distinguished road

      0  

    Default


    After reading tcsete's reply to this post http://www.sencha.com/forum/showthre...taitem+datamap , I spent some time trying to use overrides but with no success. Eventually I hit on using
    Code:
    alias: 'widget.mydataitem',
    instead of xtype even though xtype is what is used in the non-Architect DataItem examples e.g. http://www.sencha.com/blog/dive-into...touch-2-beta-2.

    The DataView now connects to mydataitem.

    I couldn't get the dataMap to work via the override either, so instead I do everything through the

    Code:
    updateRecord: function(record)
    i.e. get values from record.data and use them to update the html in mydataitem's components.

    (Maybe I'm missing something but the dataMap feature seems over-engineered ?)

    It works now, but some up to date documentation and examples would be very welcome.

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,198
    Vote Rating
    120
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by Frewland View Post
    (Maybe I'm missing something but the dataMap feature seems over-engineered ?)
    In short, yes. In 2.2 the dataMap configuration is being deprecated in favor of people writing the code to do what they want in the updateRecord method.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    paranella is on a distinguished road

      0  

    Default


    Can we have an updateRecord function example?
    Thanks

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi