My problem is that the form fields doesn't get data from json - the field is blank but I should be data in there. My code:
DictonaryApplication.Form = Ext.extend(Ext.form.FormPanel,
{
border:false,
frame:false,
url:'',
initComponent:function()
{
Ext.apply(this,
{
frame: true,
autoScroll: true, focus event not bubble up:: Im building a form in which the specified values (the ones written in the value The problem comes with password inputs because the type attributes cant be changed in IE. http://www.devcomments.com/focus-event-not-bubble-up-at58562.htmHOME | 15 Seconds : An Innovative Technique for Creating Reusuable :: Code reusuability is one of the major goals of any good object problem, one of the most common being a technique that is based on overriding a base pages OnRender() method. http://www.15seconds.com/issue/050714.htmHOME |
bodyStyle:'padding:5px 5px 0',
labelAlign: 'left',
items: this.FormFields,
reader: new Ext.data.JsonReader(
{
root: 'results'
},
['KOD_GUS']
),
buttons: [
{
text: 'Zapisz zmiany'
},{
text: 'Anuluj'
}]
});
DictonaryApplication.Form.superclass.initComponent .apply(this, arguments);
},
onRender:function()
{
this.load(
{
url: 'index.php?action=DicValues&dictonary_def='+this.db_codelist,
params: {codenum: 40335 },
method: 'GET',
waitMsg: 'Wczytywanie danych...'
});
DictonaryApplication.Form.superclass.onRender.appl y(this, arguments);
}
});
Json returns:
{"results":[{"codenum":"40335","KOD_GUS":"1 Armii Wojska Polskiego"}]}
Animal ,you are the greatest :) Thx :)
What is this.formFields?
You do not need to use a Reader if you return JSON.
But read the API docs on Action.Load: http://extjs.com/deploy/dev/docs/?class=Ext.form.Action.Load
You need success and data properties in your JSON, and the data contains properties which should match the names of form fields.
Challenging Books For A 14 Year Old?
First guitar : acoustic or electric?
|