论坛首页 Web前端技术论坛

ExtJs开发教程_001_Ext.data.Store使用方法详解

浏览 2456 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-07-11  

本系列教程基本可以看做是ExtJS API中文版+实例演示

更多内容请参看:http://www.cnblogs.com/mrye

Ext.data.Store 用法介绍

这个组件继承自Ext.data.AbstractStore

 本篇讲解了如何构造并且做一些基本使用,如果有什么疑问可以联系我QQ1330771552

下面是他的属性列表

autoLoad  //是否自动加载
autoSync //是否自动同步
buffered //允许缓冲(官方有个5000条数据的例子可以参看)
clearOnPageLoad //是否在加载新数据的时候清空旧数据
clearRemovedOnLoad//加载的时候把删除掉的数据彻底删除(所谓删除掉的数据是指store.remove())
data//数据
fields//解析数据的字段
filters//过滤器(可以参看Ext.util.Filter和Ext.ux.grid.filter.Filter)
groupDir
groupField//用哪一个字段分组
leadingBufferZone//缓冲的情况下,最多缓冲多少行
listeners//监听器,可以指定各种on事件
model//解析数据的模型,模型可以代替proxy和fields配置
pageSize//每页显示多少条数据
proxy//数据代理(其实就是发送ajax来请求数据用的)
purgePageCount//多少页清除一次缓存数据(具体是和缓冲结合使用,本文不介绍缓冲)
remoteFilter//这个属性会往服务器发送过滤条件
remoteGroup//往服务器发送分组条件(同上,做法就是表单参数提交到后台)
remoteSort//往后台发送排序条件
sortOnFilter//排序的时候进行过滤
storeId//唯一标示,让Ext.data.StoreManager来管理用的
trailingBufferZone//缓冲多少条

 

// 本页的全局pageSize
var PAGESIZE = 20;
 
var demoStore = Ext.create('Ext.data.Store', {
           // fields一定要明确指定type,这样有很多好处,比如filter能直接设为true,便会默认按照store-fields设置好的type来确定filter的类型。
           fields : [{
                     name : 'primaryKey',
                     margin: 0px !important; padding: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; border-bottom-left-radius: 0px !important; background-image: none !important; border: 0px !important; float: none !important; height: a
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics