码迷,mamicode.com
首页 > 其他好文 > 详细

'Ext.data.Store' 中的 load

时间:2016-04-21 12:00:20      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:'ext.data.store' load函数

//产品store
      window.product_store=Ext.create(‘Ext.data.Store‘,{

 fields:[
           ‘id‘,
           ‘aid‘,
           ‘webid‘,
           ‘title‘,
           ‘kindlist‘,
           ‘attrid‘,
           ‘ishidden‘,
           ‘displayorder‘,
           ‘kindname‘,
           ‘attrname‘,
           ‘themelist‘,
           ‘iconlist‘,
           ‘modtime‘,
           ‘templet‘,
           ‘url‘,
           ‘finaldestid‘,
           ‘finaldestname‘
       ],

       proxy:{
   type:‘ajax‘,
   api: {
            read: SITEURL+‘article/article/action/read‘,  //读取数据的URL
     update:SITEURL+‘article/article/action/save‘,
     destroy:SITEURL+‘article/article/action/delete‘
            },
      reader:{
              type: ‘json‘,   //获取数据的格式 
              root: ‘lists‘,
              totalProperty: ‘total‘
              }    
        },
 remoteSort:true,
       autoLoad:true,
 pageSize:30,
       listeners:{
              load:function( store, records, successful, eOpts )
              {
                  if(!successful){
                      ST.Util.showMsg("{__(‘norightmsg‘)}",5,1000);
                  }
                  var pageHtml = ST.Util.page(store.pageSize, store.currentPage, store.getTotalCount(), 10);
                  $("#line_page").html(pageHtml);
                  window.product_grid.doLayout();

                  $(".pageContainer .pagePart a").click(function () {
                      var page = $(this).attr(‘page‘);
                      product_store.loadPage(page);
                  });


              }
          }


  
     });


Ext.data.Store store, Ext.data.Model[] records, Boolean successful, Object eOpts )

每当store从远程数据源读取数据时触发此事件.

Parameters


'Ext.data.Store' 中的 load

标签:'ext.data.store' load函数

原文地址:http://westds.blog.51cto.com/9850609/1766098

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!