0

当我的列表需要从我的网络服务获取 json 结果时,是否可以制作加载栏?

这是我的代码 list.js

    Ext.define('bluebutton.view.BlueButton.MemberList', {
    extend: 'Ext.List',
    xtype: 'memberlistcard',
    requires: [
        'Ext.field.Select',
        'Ext.field.Search',
        'bluebutton.view.BlueButton.MemberDetail',
         'Ext.plugin.ListPaging',
        'Ext.plugin.PullRefresh',
        'Ext.dataview.Override'

    ],
    config: {


        styleHtmlContent: true,
        scrollable: 'vertical',
        itemHeight :20,
        variableHeights : false,
        store : { xclass : 'bluebutton.store.BlueButton.MemberList'},
       grouped: true,
        indexBar: true,

//       plugins: [
//                   
//                        { 
//                               xclass: 'Ext.plugin.ListPaging',
//                                 autoPaging: true
//                        
//                        }
//                ],

        id :'memberlist',
        items: [


        ],
        emptyText: '<p class="no-search-results">No member record found matching that search</p>',
        itemTpl: Ext.create(
            'Ext.XTemplate',
            '<div class="tweet-wrapper">',
                '<table>',
                    '<tr>',
                        '<td rowspan="2" width="28%" >',
//                        '<div style="padding-left: 30px;">',
//                        '   <img src="{imgUrl}" width="140" height="130" /></div>',
                        '</td>',
                        '<td>',
                        '   <div class="tweet">',
                        '       <h3>{consumer_bbID}</h3>',
                         '      <h3>Name: {fullName}</h3>',
                        '       <h3>Point Avalaible : {currentPoint} , Last Visited : {lastVisited}</h3>',

                        '   </div>',
                        '</td>',
                    '</tr>',
                '</table>',
            '</div>'


        ),



    },


});

Store.js

Ext.define('bluebutton.store.BlueButton.MemberList', {
    extend: 'Ext.data.Store',
   requires: [
              'bluebutton.model.BlueButton.MemberList'
    ],

    config: {
        grouper: {
            groupFn: function (record) {
                return record.get('fullName')[0];
            }
        },


           model :'bluebutton.model.BlueButton.MemberList',
           storeId :'memberStore',
            autoLoad: true,
            clearOnPageLoad: false,  // This is true by default
            pageSize: 10,



    }
});

模型.js

Ext.define('bluebutton.model.BlueButton.MemberList', {
    extend: 'Ext.data.Model',
    config: {
        idProperty: 'memberlistModel',
        fields: [
            {  name :'memberId'},
            {  name: 'fullName' },
            {  name: 'phone' },
            {  name: 'age' },
            {  name: 'point' },
            {  name :'address'},
            {  name: 'emailAddress' },
            {  name: 'lastVisited'  },
            {  name: 'consumer_bbID'  },
            {  name: 'merchant_bbID'  },
            {  name: 'sessionId'  },
            {  name: 'deviceId'  },
            {  name: 'currentPoint'  },




        ],

        proxy: {
            type: 'rest',
           url: 'http://192.168.251.131:8080/WebCommon/rest/BBWebService/getMembersList',
            reader: 'json',
            actionMethods: {
                create: 'POST',
                read: 'GET',
                update: 'PUT',
                destroy: 'DELETE'
            },


                      noCache: false, // get rid of the '_dc' url parameter

                    extraParams: {
                        sessionId: "1",
                        deviceId: "1",
                        merchant_bbID: "merchant1",

                    // add as many as you need
                },




            reader: {
                type: 'json',
                rootProperty: 'membersList'

            },

            writer: {
                type: 'json',

            },
        }



    }

});

sencha 从 Web 服务加载 json 数据时可能会延迟几秒钟?休息时从网络服务获取请求时是否可以实现加载栏

4

0 回答 0