PDA

View Full Version : How to load an extjsform into div tag with ajax?



ferdian
28 Sep 2011, 3:03 AM
Hi,
I am working on a web application that require no page reload/redirect.
So if i click a submenu, then it must change just the content and not the entire page.

I have tried

Ext.get('content').load({
url: ' url '
})

It does load the content of the url (the content is javascript) :
<script>
FormPassword = new Ext.Panel({
height: 187,
width: 400,
layout: {
type: 'absolute'
},
padding: 10,
title: ' Password',
applyTo: 'formpassword',
items : [
{
xtype: 'button',
height: 29,
width: 71,
text: 'Apply',
x: 230,
y: 120
},
{
xtype: 'button',
height: 29,
width: 71,
text: 'Cancel',
x: 310,
y: 120
},
{
xtype: 'textfield',
width: 210,
name: 'nm_pemakai',
x: 170,
y: 20
},
{
xtype: 'textfield',
width: 210,
name: 'old_pass',
x: 170,
y: 50
},
{
xtype: 'textfield',
width: 210,
name: 'new_pass',
x: 170,
y: 80
},
{
xtype: 'label',
style: 'font : Arial',
text: 'Nama Pemakai',
x: 20,
y: 20
},
{
xtype: 'label',
text: 'Password Lama',
x: 20,
y: 50
},
{
xtype: 'label',
text: 'Password Baru',
x: 20,
y: 80
}
]
});
</script>
<div id="formpassword"></div>

But it doesnt create the form into the div tag 'formpassword'..
Anyone can help?How can i load the form with ajax?

Best Regards,:)
Ferdian

ferdian
28 Sep 2011, 11:55 PM
anyone plz? i'm still working on it n cant find the solution..:(