You can just link statically required files in your index.html

<link rel="stylesheet" type="text/css" href="scripts/ext/examples/ux/grid/css/GridFilters.css" />
<link rel="stylesheet" type="text/css" href="scripts/ext/examples/ux/grid/css/RangeMenu.css" />
<script type="text/javascript" src="scripts/ext/examples/ux/grid/FiltersFeature.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/filter/Filter.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/filter/StringFilter.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/filter/ListFilter.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/filter/BooleanFilter.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/filter/NumericFilter.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/filter/DateFilter.js"></script>
<script type="text/javascript" src="scripts/ext/examples/ux/grid/menu/RangeMenu.js"></script>
 

The reason that ExtJS tries to load ".../features/filter.js" is that the object that it is looking for ("features.filter") is not yet defined. ExtJS guesses this must be in a file called "features/filter.js". However, it is actually defined in "grid/FeaturesFilter.js" (where "features.filter" is defined as an "alias" to "Ext.ux.grid.FiltersFeature").

Most people who have this problem have read the documentation and are trying to load Ext.ux.grid.FiltersFeature (usually at "ux/grid/FiltersFeature.js") but the timing of the load is such that it is not loaded when it is needed. Therefore, ExtJS tries to load the non-existent file.

The key to solving this problem is to ensure that the "Ext.ux.grid.FiltersFeature" is fully loaded (not just the load initiated) by the time the grid is initializing with the filters feature.

The sensible (and appropriate) thing is to put the "Ext.ux.grid.FiltersFeature" in the "requires"of the class extending the grid. This should ensure that the grid/FiltersFeature.js file is loaded before you need it.

// This should work
Ext.define("FrontSuite.view.MyGrid", {
extend: 'Ext.grid.Panel',
xtype: 'mygrid',
requires: [
'Ext.ux.grid.FiltersFeature'
],
title: 'My Grid',
...
features: [{
ftype : 'filters',
encode : true
}],
columns: [
{ dataIndex: 'id', text: 'ID'},
{ dataIndex: 'name', text: 'Name'}
]
}

If for some reason, the file does not load in time, you can put a (seemingly redundant) requires "Ext.ux.grid.FiltersFeature" in the Ext.application() call (ExtJS 4+).

Ext.application({
name: 'MyNamespace',
extend: 'MyNamespace.Application',
controllers: ['MyController'],
autoCreateViewport: true,
paths: {
'Ext.ux': 'path/to/my/ext/ux'
},
requires: [
'Ext.ux.grid.FiltersFeature'
]
});

IMPORTANT NOTES ON CLASS LOAD TIMING: Putting the required class in the proper "requires" config for the proper requiring class is important so that when you do a build and create a minified Javascript file, you get only the bits of the ExtJS library code that are truly needed. However, you should watch the Javascript console for messages that say that ExtJS had to load a file synchronously. If it does this, the "correct" location for a "requires" should be supplemented by a "redundant requires" somewhere earlier, such as in Ext.application() as shown above.

source:http://stackoverflow.com/questions/7359512/how-to-use-filters-in-a-gridpanel

How to use filters in a GridPanel的更多相关文章

  1. Extjs的GridPanel的RowExpander的扩展

    对Extjs的grid使用,有时候单单使用其中的某些组.或某些行是远远不够的,还需要对行进行一些扩展,如:与filters相似的row扩展控件,如下 这个控件,我也是从网上找的小例子,按照其内部的某些 ...

  2. 【Ext.Net学习笔记】05:Ext.Net GridPanel的用法(包含Filter、Sorter、Grouping、汇总(Summary)的用法)

    GridPanel是用来显示数据的表格,与ASP.NET中的GridView类似. GridPanel用法 直接看代码: <ext:GridPanel runat="server&qu ...

  3. Ext.Net学习笔记15:Ext.Net GridPanel 汇总(Summary)用法

    Ext.Net学习笔记15:Ext.Net GridPanel 汇总(Summary)用法 Summary的用法和Group一样简单,分为两步: 启用Summary功能 在Feature标签内,添加如 ...

  4. Ext.Net学习笔记12:Ext.Net GridPanel Filter用法

    Ext.Net学习笔记12:Ext.Net GridPanel Filter用法 Ext.Net GridPanel的用法在上一篇中已经介绍过,这篇笔记讲介绍Filter的用法. Filter是用来过 ...

  5. Ext.Net学习笔记14:Ext.Net GridPanel Grouping用法

    Ext.Net学习笔记14:Ext.Net GridPanel Grouping用法 Ext.Net GridPanel可以进行Group操作,例如: 如何启用Grouping功能呢?只需要在Grid ...

  6. ABP(现代ASP.NET样板开发框架)系列之13、ABP领域层——数据过滤器(Data filters)

    点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之13.ABP领域层——数据过滤器(Data filters) ABP是“ASP.NET Boilerplate P ...

  7. ASP.NET MVC Filters 4种默认过滤器的使用【附示例】

    过滤器(Filters)的出现使得我们可以在ASP.NET MVC程序里更好的控制浏览器请求过来的URL,不是每个请求都会响应内容,只响应特定内容给那些有特定权限的用户,过滤器理论上有以下功能: 判断 ...

  8. 无废话ExtJs 入门教程十七[列表:GridPanel]

    无废话ExtJs 入门教程十七[列表:GridPanel] extjs技术交流,欢迎加群(201926085) 在Extjs中,GridPanel用于数据显示,即我们平时说的列表页.在本节中,我们先对 ...

  9. Ext GridPanel

    Extjs GridPanel用法详解 创建GridPanel 要使用GridPanel,首先要定义Store,而在创建Store的时候必须要有Model,因此我们首先来定义Model: //1.定义 ...

随机推荐

  1. SpringBoot log4j2 异常

    log4j 配置 <dependency> <groupId>org.springframework.boot</groupId> <artifactId&g ...

  2. LeetCode(71) Simplify Path

    题目 Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/&quo ...

  3. Hibernate入门(1)——环境搭建

    什么是Hibernate?为什么使用Hibernate?Hibernate有什么优缺点?网上很多大神的文章又详细又通俗易懂. 步骤: 1.创建数据库表格. 2.编写JavaBean实体类. 3.下载H ...

  4. [MVC]在练习MusicStore过程中问题实录

    1,问题描述:MVC在添加基于框架的控制器时,出现无法检索xxx的元数据 参考目录:http://www.cnblogs.com/0banana0/p/4050793.html#undefined 解 ...

  5. Android开发——查询/杀死手机里正在运行的进程

    0. 前言 以前有同学好像做过一个叫"自习君"的App,开启后自动检测用户这一天的自习时间,在学校里宣传广告还打了不少.其实实现原理非常简单,在SQlite数据库(也可以通过文件) ...

  6. sysctl.conf文件配置详解

    ############################# net.inet.ip.sourceroute=0 net.inet.ip.accept_sourceroute=0 ########### ...

  7. AutoItLibrary之键盘操作(send)

    最近有人问到我键盘操作用什么库?用到库里面的哪个方法?我在这里总结一下,第一次写,有片面的地方还请指出,一块进步.1.首先,用到的库是AutoItLibrary,用到的方法是send:按F5可用看到 ...

  8. bzoj 1702 贪心,前缀和

    [Usaco2007 Mar]Gold Balanced Lineup 平衡的队列 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 807  Solved: ...

  9. linux 安装报错:pkg-config not found

    linux 安装报错:pkg-config not found 使用编译安装时,在执行./configure时报如下错误: ... ... checking for pkg-config... no ...

  10. windows7 下安装使用memcached

    Memcached 安装使用 本地环境:Windows7 64位web环境:wamp集成环境,php版本:PHP Version 7.1.17 学习参考网站: RUNOOB.COM官网  http:/ ...