-
24 Feb 2008 1:11 PM #1
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
Good work guys. really.PHP Code:var form = new Ext.FormPanel({
labelAlign: 'right',
applyTo:'form-ct4',//the div in the example i'd like to be dynamic
labelWidth: 75,
layout:'column',
items:[{
columnWidth:.5,
items:[fieldSet1,fieldSet2]
},
{
columnWidth:.5,
items:[fieldSet3,fieldSet4]
}
]
});
-
4 Oct 2008 9:19 PM #2
Hello,
Do you find a solutin to your problem ? Because i would like to do the same thing.
Thank you.
nicolas
-
5 Oct 2008 12:46 AM #3
What do you want to do?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
5 Oct 2008 3:04 AM #4
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 Oct 2008 4:01 AM #5
Use contentEl.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
5 Oct 2008 5:18 AM #6
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
-
5 Oct 2008 5:56 AM #7
http://extjs-ux.org/docs/
http://extjs-ux.org/twiki/bin/view/Main/ExtUxRepository
Ext.ux.layout.TemplateSearch the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
5 Oct 2008 6:05 AM #8
thank you for your help,
i will check these links
-
7 Oct 2008 2:45 PM #9
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.


Reply With Quote