I have an application where i am using sencha touch JS API for UI rendering. The UI works fine in chrome browser but not working in Android or iPhone device.
i have used the following code.
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var store1 = new Ext.data.JsonStore({
model : 'Contact',
autoLoad : true,
autoDestroy : true,
data: [
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Rob', lastName: 'Dougan'},
{firstName开发者_JAVA百科: 'Ed', lastName: 'Spencer'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'}
]
});
new Ext.Application({
launch: function() {
var panel = new Ext.Panel({
fullscreen: true,
id:'thePanel',
layout: 'auto',
style: 'background-color:darkblue',
scroll:'vertical'
});
//do this in your dynamically called function
var list = new Ext.List({
id :'theList',
itemTpl : '{firstName} {lastName}',
store: store1,
width: '100%',
scroll:false
});
var stateList = new Ext.form.Select({
label : 'State',
widht: '100%',
options: [
{text: 'First Option', value: 'first'},
{text: 'Second Option', value: 'second'},
{text: 'Third Option', value: 'third'}
],
autoLoad : true,
autoDestroy : true
});
panel.items.add(list);
panel.items.add(stateList);
panel.doLayout();
}
});
It gives the UI like as shown in the image. But the select control is not working for (State list in not populating). please help me.
Each form field needs to have a name property, i.e. the name of the parameter to be send when the form is submitted. Updated your stateList object like this:
var stateList = new Ext.form.Select({
label : 'State',
name: 'selectField',
width: '100%',
options: [
{text: 'First Option', value: 'first'},
{text: 'Second Option', value: 'second'},
{text: 'Third Option', value: 'third'}
],
autoLoad : true,
autoDestroy : true
});
精彩评论