Hey!
I have a problem with loading a jsonstore and write a value in a textfield.
var LicenseData = new Ext.data.JsonStore({
url: '../../libs/sysconfig/get-information.php', Grid Filter (Plugin) [Archive] - Page 2 - Ext JS Forums:: that the arrows keys dont work inside the text field in your extension. { proxy: new Ext.ux.data.PagingMemoryProxy(js.reader.jsonData), reader: js.reader, http://extjs.com/forum/archive/index.php/t-14503-p-2.htmlHOME |
baseParams:{module:'sysLicense'},
root: 'SystemLicense',
fields: ['companyname', 'address','city','country']
});
LicenseData.on('load', function(store) {
console.debug(LicenseData);
FieldCompanyname.setValue(LicenseData.getAt(0).dat a.companyname);
});
LicenseData.load();
[...]
items: [
{
fieldLabel: Lang.LicenseCompanyname,
name: 'FieldCompanyname',
id:'FieldCompanyname'
},{[...]
get-information.php response me
{success: true, SystemLicense :{"companyname":"Master GmbH","address":"Strasse 4","city":"12345 City","country":"Germany"}}
The firebug told me 四水流年 - JavaEye技术网站:: 走自己的路,没有屈服,没有束缚 表名=case when a.colorder=1 then d.name else end, insert into TestTable([id], FirstName, LastName, Country,Note) values(@i, http://zhanglei14616-163-com.javaeye.com/blog/monthblog/2008-07?show_full=trueHOME |
LicenseData.getAt(0) has no properties
[Break on this error] FieldCompanyname.setValue(LicenseData.getAt(0).dat a.companyname);
Where ist my mistake?
SystemLicense in the json needs to be an array:
{success: true, SystemLicense :[{"companyname":"Master GmbH","address":"Strasse 4","city":"12345 City","country":"Germany"}]}
note that using a store to load a single record is a bit of overkill, as you could do it with just a normal ajax request.
Oh, ive found the mistake. And, yes of course it is very overkilled. But, now there are much more records.
If you have only one record the json_encode function of php response:
{success: true, SystemLicense :{"companyname":"Master GmbH","address":"Strasse 4","city":"12345 City","country":"Germany"}}
If there more records the function returns:
{success: true, SystemLicense :[{"companyname":"Master GmbH","address":"Strasse 4","city":"12345 City","country":"Germany"},
{"companyname":"Master GmbH","address":"Strasse 4","city":"12345 City","country":"Germany"}]}
If the response have more items, i can get them with getAt().
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market |