-
12 Sep 2011 2:37 AM #1
ExtJS4 Loading formPanel from PHP
ExtJS4 Loading formPanel from PHP
I am trying to load formPanel from PHP (return Json)
On ExtJS 3.2 it works, but not in ExtJS4
Can anybody help me with this???Code:SettingsForm.getForm().load({ url:'http://borsuko4/php/settings.php?action=showData', success : function() {alert('success ');} });
Thanks
-
12 Sep 2011 4:09 AM #2
Wich error are you getting on this? look at Firebug or google console and tell us more please.
-
12 Sep 2011 4:15 AM #3
firebug show me this error :
this.model is undefined
[Break On This Error] return this.model.prototype.fields.items;
-
12 Sep 2011 5:35 AM #4
seems like you have a problem with your ajax loader, may be you need to check your model def for the data loaded, check the AJAX example at: http://docs.sencha.com/ext-js/4-0/#!.../xml-form.html
-
17 Oct 2011 9:08 AM #5
same problem with json
same problem with json
same problem with json
-
6 Dec 2011 7:36 PM #6
i have the same problem.
can anyobody help us ?
-
10 Dec 2011 5:05 AM #7
Can you provide a non-working example?
-
18 May 2012 4:40 PM #8
[SOLVED]: you must create model first
[SOLVED]: you must create model first
json:
make model:PHP Code:({"total":"1", "hasil" : [{"id":"1","username":"admin","password":"123","nama":"Budi", "lastLogin":"2012-05-18 23:13:07"}]})
and then in form panel:PHP Code:Ext.define('mdlProfil',{
extend:'Ext.data.Model',
fields:[
{name: 'id', type: 'int', mapping: 'id'},
{name: 'username', type: 'string', mapping: 'username'},
{name: 'nama', type: 'string', mapping: 'nama'},
{name: 'password', type: 'string', mapping: 'password'},
{name: 'lastLogin', type: 'string', mapping: 'lastLogin', dateFormat: 'd-M-Y'}
]
});
don't forget to load:PHP Code:var frmProfil = Ext.create('Ext.form.Panel', {
...
reader : Ext.create('Ext.data.reader.Json', {
model: 'mdlProfil',
root: 'hasil'
}),
...
PHP Code:frmProfil.getForm().load({url: 'ProfilController.php', method: 'POST', params: {aksi: 'aksiInit'}});
-
12 Feb 2013 11:12 PM #9
load php on absolute form
load php on absolute form
hai soemi ,i try your code and it work,but i try on absolute layout browser (http://cdn.sencha.io/ext-4.1.1a-gpl/...t-browser.html ) it does not work. can you show some example ? the code :
function getCombinationLayouts() {
return {
start: {
id: 'start-panel',
title: 'Start Page',
layout: 'fit',
bodyStyle: 'padding:25px',
contentEl: 'start-div' // pull existing content from the page
},
absoluteForm: {
title: 'Absolute Layout Form',
id: 'abs-form-panel',
layout: 'fit',
bodyPadding: 15,
items: {
title: 'New Email',
layout: 'fit',
frame: true,
items: {
xtype: 'form',
layout:'absolute',
padding: '5 5 0 5',
border: false,
cls: 'absolute-form-panel-body',
defaultType: 'textfield',
items: [{
x: 0,
y: 5,
xtype: 'label',
text: 'From:'
},{
x: 55,
y: 0,
name: 'from',
hideLabel: true,
anchor:'100%' // anchor width by %
}]
}
}
}
};
}


Reply With Quote