将日期从存储装载到组合框 [英] Load date from store to combobox

查看:140
本文介绍了将日期从存储装载到组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我从服务器日期到以url:/ book / price存储。这个响应来自服务器
{
status:SUCCESS,
msg:операциязавершенауспешно,
data:[
500,
600
]
}

Hello i am get from server date to store with "url: /book/price" . And this response comes from the server { status: "SUCCESS", msg: "операция завершена успешно", data: [ "500", "600" ] }

我想在组合框中插入。
我是创建商店,但不知道写什么:
这个商店:

This information from "data" I want to insert in combobox. I am create store, but don't know what write there: this store:

Ext.define('TPL.store.price.Book', {
extend: 'Ext.data.BaseStore',
autoLoad: true,
proxy: {
    type: 'ajax',
    url: '/book/price',
    reader: {
        type: 'json',
        root: 'data',
        successProperty: 'success'
    }
}});

在combobox中我不知道在valuefield中写什么

And in combobox i am don't know what write in valuefield

{
                xtype: 'combobox',
                width: 350,
                store: 'price.Book', 
                 valueField: '???'
            }

感谢所有答案

推荐答案

您的代理应为:

proxy: {
    type: 'ajax',
    url: '/book/price',
    reader: {
        type: 'json',
        root: 'data',
        successProperty: 'status' <-
    }
}


$ b b

,如果您的商店有数组格式的数据,您可以忽略 valueField 属性。

这篇关于将日期从存储装载到组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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