开发者

Select options in sencha touch is not working for android

开发者 https://www.devze.com 2023-04-07 06:25 出处:网络
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 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();               
    }
});

Select options in sencha touch is not working for android

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

});

0

精彩评论

暂无评论...
验证码 换一张
取 消