在煎茶触摸选择的选项不能正常工作为Android [英] Select options in sencha touch is not working for android

查看:102
本文介绍了在煎茶触摸选择的选项不能正常工作为Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在哪里,我使用煎茶触摸JS API,用于渲染UI的应用程序。用户界面工作在Chrome浏览器不错,但在Android或iPhone设备不工作。

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.

我用下面的code。

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: '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.

推荐答案

每个表单字段需要有一个name属性,即参数的名称是表单提交时发送。更新你的stateList对象是这样的:

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

});

这篇关于在煎茶触摸选择的选项不能正常工作为Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆