• sencha touch json store


    js:

    Ext.define('MyApp.store.MyJsonStore', {
        extend: 'Ext.data.Store',
    
        requires: [
            'MyApp.model.Person',
            'Ext.data.proxy.Ajax',
            'Ext.data.reader.Json'
        ],
    
        config: {
            autoLoad: true,
            data: [
                {
                    id: 909,
                    firstName: 'Anthony',
                    lastName: 'Hill'
                }
            ],
            groupField: 'lastName',
            model: 'MyApp.model.Person',
            storeId: 'MyJsonStore',
            proxy: {
                type: 'ajax',
                url: '/a.js',
                reader: {
                    type: 'json'
                }
            }
        }
    });

    json from server:

    [
        { id: 1, firstName: 'Tommy laptop', lastName: 'Maintz' },
        { id: 2, firstName: 'Rob', lastName: 'Dougan' },
        { id: 3, firstName: 'Ed', lastName: 'Avins' },
        { id: 4, firstName: 'Jamie laptop', lastName: 'Avins' },
        { id: 5, firstName: 'Dave', lastName: 'Dougan' },
        { id: 6, firstName: 'Abraham', lastName: 'Elias' },
        { id: 7, firstName: 'Jacky', lastName: 'Ngyuyen' },
        { id: 8, firstName: 'Jay', lastName: 'Ngyuyen' },
        { id: 9, firstName: 'Jay', lastName: 'Robinson' },
        { id: 10, firstName: 'Rob', lastName: 'Avins' },
        { id: 11, firstName: 'Ed', lastName: 'Dougan' },
        { id: 12, firstName: 'Jamie', lastName: 'Poulden' },
        { id: 13, firstName: 'Dave', lastName: 'Spencer' },
        { id: 14, firstName: 'Abraham', lastName: 'Avins' },
        { id: 15, firstName: 'Jacky', lastName: 'Avins' },
        { id: 16, firstName: 'Rob', lastName: 'Kaneda' },
        { id: 17, firstName: 'Ed', lastName: 'Elias' },
        { id: 18, firstName: 'Tommy', lastName: 'Dougan' },
        { id: 19, firstName: 'Rob', lastName: 'Robinson' }
    ]
  • 相关阅读:
    Django之模板层
    Django之视图层
    Django路由系统
    Django request对象与ORM简介
    浏览器不能访问bing
    SQL问题:com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value
    IDEA用Maven创建SpringMVC项目和配置
    离线安装pyinstaller
    flink1.11-报错问题
    maven的pom文件报红
  • 原文地址:https://www.cnblogs.com/zyip/p/3525503.html
Copyright © 2020-2023  润新知