1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    11
    Vote Rating
    0
    lightxx is on a distinguished road

      0  

    Default Unanswered: Showing an image in a view, the MVC way

    Unanswered: Showing an image in a view, the MVC way


    given the example here (http://docs.sencha.com/ext-js/4-0/#!...n_architecture , section "Controlling the grid"), i see how fields from the current record are passed along to the view that edits the users.

    given that example, how would i show an image that depends on a value of the record that gets passed to the view?

    i can pass along a parameter in the controller while instantiating the view, like
    Code:
    var view =Ext.widget('useredit', {someparam: 'somevalue'});
    and retrieve this parameter in the view via
    Code:
    this.someparam
    , but that doesn't seem very MVC compliant to me.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Answers
    655
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    The use of MVC is to organize your code and allow others to follow. This does not mean that you need to stop using basic methods in your code.

    Your controller simply handles where the actions are called.

    Scott.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    11
    Vote Rating
    0
    lightxx is on a distinguished road

      0  

    Default


    erm ... ok. that's not what i ment.

    i have a model like this

    Code:
    Ext.define('MM.model.Magnet', {    extend: 'Ext.data.Model',
        fields: [
                        { name: 'id', mapping: '@id', type: 'int'}, 
                        'title', 'contributor_id', 'img_name', 'city', 'notes', 'country_id',
                        { name: 'country', sortType: 'asCountry', convert: lookupCountry },
                        { name: 'contributor', convert: lookupContributor }
                    ]
    });
    img_name is the path of the image I'm trying to show in the view. so by passing that path as parameter while instantiating the view I would do something already done by the command
    Code:
     view.down('form').loadRecord(record);
    what I'm really asking for is an easy way to do an image form component. sticking to the example from my first post, something like

    Code:
    xtype: 'form',                items: [
                        {
                            xtype: 'textfield',
                            name : 'name',
                            fieldLabel: 'Name'
                        },
                        {
                            xtype: 'textfield',
                            name : 'email',
                            fieldLabel: 'Email'
                        },
                         {
                            xtype: 'imagefield',
                            name : 'someimage',
                            fieldLabel: 'An Image'
                        }
    
                    ]

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Posts
    11
    Vote Rating
    0
    lightxx is on a distinguished road

      0  

    Default


    this is what I'm looking for (just a stripped down version I can actually understand)

    http://stackoverflow.com/questions/1...32203#10932203

Thread Participants: 1

Tags for this Thread

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..."