1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    50
    Vote Rating
    0
    Severance is on a distinguished road

      0  

    Default form in a template

    form in a template


    Hello all !!

    I have a simple question : how to add a form in a template ?

    So I have this code working well :

    var infos = new Ext.Component({
    title: 'Infos',
    cls: 'infos',
    iconCls: 'user',
    scroll: 'vertical',
    tpl: [
    '<tpl for=".">',
    '<p>Utilisateur : '+utilisateur.loginUtilisateur+'</p>',
    '</tpl>'
    ]
    });

    I want to add a form button in the tpl.

    How can I do that ?

    thanks !

  2. #2
    Sencha User
    Join Date
    Sep 2010
    Posts
    50
    Vote Rating
    0
    Severance is on a distinguished road

      0  

    Default


    up, I think it is not so hard, is it ?

  3. #3
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    No, it's currently not supported to use forms in templates. Why would you want to do that though? Just put the form as a child item of the container.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Posts
    50
    Vote Rating
    0
    Severance is on a distinguished road

      0  

    Default


    could you give me an example of a child ?

  5. #5
    Sencha User
    Join Date
    Jan 2011
    Posts
    134
    Vote Rating
    5
    JRS is on a distinguished road

      0  

    Default Did you ever find a solution?

    Did you ever find a solution?


    Was a solution found for this?

  6. #6
    Sencha User
    Join Date
    Jul 2011
    Location
    Holland
    Posts
    97
    Vote Rating
    0
    mrduck is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by evant View Post
    No, it's currently not supported to use forms in templates. Why would you want to do that though? Just put the form as a child item of the container.
    I'd like to have a dynamic amount of fields, dynamic field names and want to put two textfields next to each other.
    That's why it would be easy to use Xtemplates in form pages.

    Is there any solution currently in ST1.1

  7. #7
    Sencha User
    Join Date
    Jul 2011
    Posts
    4
    Vote Rating
    0
    gmz is on a distinguished road

      0  

    Default


    I've done something like this. I don't have any simple example, but will describe how it worked:
    I have an empty component (Panel), and dynamically add children in a loop. In my case children are form-panel's, so I can load data from some Store or from Ajax call.

    Something like this:
    Code:
    //parent class:
    App.views.XParent = Ext.extend(Ext.Panel, {
        id: 'xParent',
        layout: 'auto',
        scroll: 'vertical',
        items: [
        ],
    });
    Ext.reg('xParent', App.views.XParent);
    
    //children class:
    App.views.XChild  = Ext.extend(Ext.form.FormPanel, {
        items:[{
            xtype: 'fieldset',
            items: [
                //define fields here
            ]
        }]
    });
    Ext.reg('xChild', App.views.xChildren);
    
    //Function creating children.
    createChildren: function(data){
        var parent = Ext.getCmp('xParent');    
        
        parent.removeAll();
        for(var i=0; i<data.length; ++i){
            //create component
            var newCmp = Ext.create({ 
                xtype: 'xChild', 
                id: ('xChild_'+i)    //optional
            });
            
            //load data to form fields
            newCmp.load(data[i]);
            
            newCmp.items.getComponent(0).setTitle('Item nr. '+(i+1));
            
            parent.add(cmp);        
        }
        
        parent.doLayout();
    }

  8. #8
    Sencha User
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    9
    Vote Rating
    1
    SunilRao is on a distinguished road

      0  

    Default


    Hey Hi,
    I'm new to Sencha
    Can you show me how to use setValues() in form.
    Please!

Similar Threads

  1. Could i get template form html file?
    By zsumore in forum Community Discussion
    Replies: 0
    Last Post: 1 Nov 2008, 5:35 PM
  2. Question about form Template...
    By haldrix in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 7 Oct 2008, 2:45 PM
  3. Form + Custom Layout, maybe template?
    By enterco in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 1 Apr 2008, 11:24 AM
  4. Help needed !! Template Form
    By fredleput in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 30 Jul 2007, 8:13 AM
  5. Need: Example on Ext.form together with template
    By Joche in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 24 Apr 2007, 5:13 PM

Thread Participants: 5

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