PDA

View Full Version : How to pass value from json request to Ext.Field?



boydapa3
20 Mar 2007, 9:14 PM
I need an Input Field that update its value after a trigger..

the value comes from a json request then pass it to Ext.Field.

can you help me guys?

Thanks!!

mystix
20 Mar 2007, 10:25 PM
i *think* this request should go into the Help forum http://www.yui-ext.com/forum/viewforum.php?f=4. :wink:

jack.slocum
20 Mar 2007, 11:42 PM
setValue()?

boydapa3
20 Mar 2007, 11:56 PM
I already solve that but i have new problem..

the Input Field is inside the basic dialog and the value that I set to the field doesnt show after dialog.show.. it will show after I hide it and show it again..



...
var companyName = new Ext.form.Field({
allowBlank:false,
msgFx: 'slide'
});
companyName.applyTo('company_name_form');
...

companyName.setValue(comp_name);

......
dialog.show();

boydapa3
20 Mar 2007, 11:59 PM
I'm still searchng for posible solution.. I found something like this..



Ext.get("foo").load({
url: "edit.php",
scripts:true,
params: "for=bar",
text: "Loading Foo..."
});


can I use this one? how?

Thanks!!

Belgabor
21 Mar 2007, 7:22 AM
I guess it won't work for you. It's a shortcut to getting the Elements UpdateManager and calling load on that. This as far as I know updates innerHTML and not value, which would be required for an input.
You may be interested in my AjaxForm. See the respective thread in the Examples forum and my example page in my signature. I'll see to get up an example that shows how to use inputs soon (currently there is only one display-only example).