1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    73
    Vote Rating
    -1
    PhilChill is an unknown quantity at this point

      0  

    Default Answered: image in fieldset

    Answered: image in fieldset


    Hey guys,

    i want to add a image in a fieldset. At the moment i'm so far that i have the image in top over the fieldset.
    IMG_0288.jpg

    My code in the form is so

    Code:
    Ext.define('MobileLogin.view.customer.CustomerForm', {    extend: 'Ext.form.Panel',
        xtype: 'customerPage',
        id: 'customerForm',
        config: {
        title: 'CustomerForm',
        iconCls: 'user',
        autoDestroy: false,
        layout: 'fit', //for the image vbox
        items: [
        {
            xtype: 'fieldset',
            scrollable: true,
            items: [
            {
            xtype: 'textfield',
            id   : 'customerName',
            name : 'customerName',
            label: 'Name',
            listeners: {
                painted: function(){
                if(MobileLogin._lockedBy){
                    this.setReadOnly(true);
                }
                }
            }
            },
            {
            xtype: 'textfield',
            id   : 'customerCompany',
            name : 'customerCompany',
            label: 'Company',
            listeners: {
                painted: function(){
                if(MobileLogin._lockedBy){
                    this.setReadOnly(true);
                }
                }
            }
            },
            {
            xtype: 'emailfield',
            id   : 'customerEmail',
            name: 'customerEmail',
            label: 'Email',
            listeners: {
                painted: function(){
                if(MobileLogin._lockedBy){
                    this.setReadOnly(true);
                }
                }
            }
            },
            {
            xtype: 'textfield', //numberfield
            id   : 'customerPhone',
            name : 'customerPhone',
            label: 'Phone',
            listeners: {
                painted: function(){
                if(MobileLogin._lockedBy){
                    this.setReadOnly(true);
                }
                }
            }
            },
            {
            xtype: 'textareafield',
            id   : 'customerDescription',
            name : 'customerDescription',
            label: 'Description',
            listeners: {
                painted: function(){
                if(MobileLogin._lockedBy){
                    this.setReadOnly(true);
                }
                }
            }
            }
            ]  
        }
        ],
        listeners: {
            initialize: function(){
            var controller = MobileLogin.application.getController('CustomerController');
            controller.getCustomerData();    
            }
        }
        }
    });
    I tried to change the layout to vbox and to put the image in the fieldset but the image was not visible in the view. At the moment i"m using another class to add the image here is the code from the other class

    Code:
    Ext.define('MobileLogin.view.customer.Customer', {    extend: 'Ext.Container',
        xtype: 'customer',
        requires: [
        'MobileLogin.view.customer.CustomerForm',
        ],
    
    
        config: {
        layout: 'vbox', 
        title: 'Customer',
        scrollable: false,
        iconCls: 'user',
        items: [
            {
            docked: 'top',
            xtype: 'titlebar',
            title: 'Customer',
            items: [
            {
            xtype: 'button',  
            text: 'Back', 
            ui: 'back', 
            action: 'backButton',
            align: 'left'
            },
            {
            xtype: 'spacer'  
            },
            {
            xtype: 'button',  
            text: 'Save', 
            ui: 'normal', 
            action: 'submitCustomer',
            //id: 'saveButton',
            align: 'right'
            }          
            ]
        },
        {
            xtype: 'image',
            src: 'http://www.osnews.com/images/user.jpg',
            height: 50,
            flex: 1
        },
        {
            xtype: 'customerPage', 
            flex: 2,
            scrollable: true
        }
        ]
        }
    });
    This was working but is not looking so nice. I would like to add the image in the fieldset and give it then the label picture.

  2. instead of putting it outside of the fieldset, try to put it in a field type and in the component put the image. this will make a field, with the label and component, and the component will be what you set it as, in this case, an image.

    Code:
     {xtype: 'field', label: 'my label', component: {xtype: 'image', src: 'imgsrc', height: 50}}

  3. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Answers
    3
    Vote Rating
    0
    shivbhaw is on a distinguished road

      0  

    Default


    instead of putting it outside of the fieldset, try to put it in a field type and in the component put the image. this will make a field, with the label and component, and the component will be what you set it as, in this case, an image.

    Code:
     {xtype: 'field', label: 'my label', component: {xtype: 'image', src: 'imgsrc', height: 50}}

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    73
    Vote Rating
    -1
    PhilChill is an unknown quantity at this point

      0  

    Default


    Yes thank you is working nice

  5. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    5
    Vote Rating
    0
    sebfie is on a distinguished road

      0  

    Default


    How can we use this component to show the current image of my model? I mean set the src dynamicaly.

  6. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    37
    Answers
    3
    Vote Rating
    0
    shivbhaw is on a distinguished road

      0  

    Default


    check out dataview and/or dataitem. should be able to use that to set it dynamically

Thread Participants: 2

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