1. #1
    Sencha Premium Member
    Join Date
    Dec 2007
    Location
    Lille, France
    Posts
    30
    Vote Rating
    0
    haldrix is on a distinguished road

      0  

    Question Question about form Template...

    Question about form Template...


    Hi all !

    First of all, this framework is simply amazing ! I'm so bad in css handling that using this framework helps me to concentrate only on the business logic and it's so nice believe me ! Well not completly... .

    I've a question about making a form that i can use as a template in my tabs. I don't know how i can use a div like the one in dynamic.html (http://extjs.com/deploy/ext/examples/form/dynamic.html) and call it with one function with some data. I tried the template object connected to the form but nothing interesting...
    The question is simply how can i make a generic div that the form can applyTo ? The user can open multi forms in a separate tab that's the problem for me.
    Help me to find the good way

    PHP Code:
    var form = new Ext.FormPanel({
            
    labelAlign'right',
            
    applyTo:'form-ct4',//the div in the example i'd like to be dynamic
            
    labelWidth75,
            
    layout:'column',
            
    items:[{
                
    columnWidth:.5,
                
    items:[fieldSet1,fieldSet2]
                },
                {
                
    columnWidth:.5,
                
    items:[fieldSet3,fieldSet4]
                }
                ]
            }); 
    Good work guys. really.

  2. #2
    Ext User
    Join Date
    Sep 2008
    Posts
    12
    Vote Rating
    0
    nicodev is on a distinguished road

      0  

    Default


    Hello,


    Do you find a solutin to your problem ? Because i would like to do the same thing.

    Thank you.

    nicolas

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    What do you want to do?

  4. #4
    Ext User
    Join Date
    Sep 2008
    Posts
    12
    Vote Rating
    0
    nicodev is on a distinguished road

      0  

    Default


    hello Animal,

    In fact i'm trying to find the best solution to write a website with Ext framework in multi languages environment.


    How I can build an Ext.form.Panel from an existing div object ?

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Use contentEl.

  6. #6
    Ext User
    Join Date
    Sep 2008
    Posts
    12
    Vote Rating
    0
    nicodev is on a distinguished road

      0  

    Default


    mmmm... my question was not very clear :+)

    I would like to know if it's possible to use a kind of XTemplate to build an Ext.form.FormPanel


    For example :

    the web server generate a page that contains :


    1) the language definition in a variable :

    <script>
    var lang = {
    name : "Name",
    firstname : "FirstName",
    address : "My address"
    }
    </script>


    2) a "template" to build our form :

    <div id="form-template">
    <field>{name}</field>
    <field>{firstname}</field>
    <field>{address}</field>
    </div>


    3) the target dom element :

    <div id='div-form'>
    </div>





    The client-side script do something like that :

    // we apply the language
    var tpl = new Ext.XTemplate.from('form-template');
    var html = tpl.apply(lang);



    The last step is to use the html code to build dynamically an Ext.form.FormPanel.


    How could we do the last step ?


    I don't know if it's very clear :p

  7. #7

  8. #8
    Ext User
    Join Date
    Sep 2008
    Posts
    12
    Vote Rating
    0
    nicodev is on a distinguished road

      0  

    Default


    thank you for your help,

    i will check these links

  9. #9
    Ext User
    Join Date
    Sep 2008
    Posts
    12
    Vote Rating
    0
    nicodev is on a distinguished road

      0  

    Default


    do you have an example of how to apply an Ext.form.FormPanel to an existing dom form ?

    I'm trying something like this :

    <form id="my-form" name="my-form" action="">
    <input type="radio" name="sex" id="male" />
    <label for="male">Male</label>
    <br/>
    <input type="radio" name="sex" id="female" />
    <label for="female">Female</label>
    </form>


    Ext.onReady(
    function(){
    var t= new Ext.form.Radio({
    allowBlank:false,
    applyTo:'male',
    width:80,
    height:20
    });
    var s= new Ext.form.Radio({
    allowBlank:false,
    applyTo:'female',
    width:80,
    height:20
    });
    new Ext.form.FormPanel({applyTo:'my-form,items:[t,s]}).
    });

    But it does not work, when radio is clicked we got an "this.body has no properties"



    Thank you for your help.




Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar