Results 1 to 8 of 8

Thread: extjs4.0.7 Custom Grid Filters - how to implement?

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2
    Vote Rating
    4
      0  

    Default Answered: extjs4.0.7 Custom Grid Filters - how to implement?

    I took a look at the example
    http://docs.sencha.com/ext-js/4-1/#!/example/grid-filtering/grid-filter-local.html

    but it doesn't work with my 4.0.7 version. I don't have the dir 'ux'.
    Even if I copy the source code from the docs I didn't get it to work.

    Does anybody know a working example, please?
    new to ExtJS

  2. Hi,
    you can additionally put in your index.html:

    Code:
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/FiltersFeature.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/menu/ListMenu.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/menu/RangeMenu.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/BooleanFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/DateFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/ListFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/NumericFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/StringFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/Filter.js">
    Maybe you have some problems with your paths.
    Did you get any example working on your system? Did you get your app working without filters? How does it look your index.html? Maybe you can post your code and a screenshot of your project folders.
    I don't think that the problem is between your php framework and the Loader. And try to use ExtJS 4.1.1, since there are a lot of changes in the filter classes and a lot of bugs are fixed.

  3. #2
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124
    Vote Rating
    91
      0  
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Hello,

    thanks, but that's the example I've tried allready.

    Maybe this information helps to find out whats wrong:
    I get an error the a class is missing: "feature.filters", and that's true.
    Inside the ext src folder there is no such file.

    Only these files are present:
    \extjs407\src\grid\feature\AbstractSummary.js
    \extjs407\src\grid\feature\Chunking.js
    \extjs407\src\grid\feature\Feature.js
    \extjs407\src\grid\feature\Grouping.js
    \extjs407\src\grid\feature\GroupingSummary.js
    \extjs407\src\grid\feature\RowBody.js
    \extjs407\src\grid\feature\RowWrap.js
    \extjs407\src\grid\feature\Summary.js
    new to ExtJS

  5. #4
    Touch Premium Member msinn's Avatar
    Join Date
    Jul 2009
    Location
    in front of my pc
    Posts
    280
    Answers
    4
    Vote Rating
    5
      0  

    Default

    Hi, add in your index.html:

    Code:
        <link rel="stylesheet" type="text/css" href="your/path/to/extjs4/examples/ux/grid/css/GridFilters.css"/>
        <link rel="stylesheet" type="text/css" href="your/path/to/extjs4/examples/ux/grid/css/RangeMenu.css"/>
    and in your app.js:
    Code:
    Ext.Loader.setConfig({
        disableCaching: false,
        enabled: true,
        paths: {
            'Ext.ux': 'your/path/to/extjs4/examples/ux'
        }
    });
    
    Ext.application({
        requires: [
            'Ext.ux.grid.FiltersFeature'
        ],
    ...
    First I would like to thank you for your time and knowledge

    Win 7 Ext JS 4.1.3 IE(6-9), FF17

  6. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Thanks, msinn! That explains, why I didn't find the filter feature.
    Is there a way to 'include' the
    Ext.ux.grid.FiltersFeature
    without using the loader?
    My php-framework currently doesn't support requests from the Ext.loader and my ExtJS app doesn't make any use of the loader.

    Also strange: the request, performed by the loader, looks like this:
    Request URL:
    http://localhost/pathtomyproject/feature/undefined.js

    seems that something's still wrong, even if I would extend my php-framework to support the Ext.loader.
    new to ExtJS

  7. #6
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2
    Vote Rating
    4
      0  

    Default

    It's working without the loader now ...

    I've put all js-file links into my html-file:
    PHP Code:
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/filter/BooleanFilter.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/filter/DateFilter.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/filter/Filter.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/filter/ListFilter.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/filter/NumericFilter.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/filter/StringFilter.js"></script>

        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/menu/ListMenu.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/menu/RangeMenu.js"></script>

        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/FiltersFeature.js"></script>
        <script type="text/javascript" src="/js/extjs407/examples/ux/grid/TransformGrid.js"></script> 
    now I'm able to create a filter obj like this:
    PHP Code:
               var gridfilters Ext.create('Ext.ux.grid.FiltersFeature',
                    {
                        
    encode :false// json encode the filter query
                        
    local  :false// defaults to false (remote filtering)
                        
    filters:[
                            {
                                
    type     :'string',
                                
    dataIndex:'timestamp'
                            
    }
                        ]
                    }); 
    Many thanks again for pointing me in the right direction. Without it, I never had a chance to get it done!
    new to ExtJS

  8. #7
    Touch Premium Member msinn's Avatar
    Join Date
    Jul 2009
    Location
    in front of my pc
    Posts
    280
    Answers
    4
    Vote Rating
    5
      0  

    Default

    Hi,
    you can additionally put in your index.html:

    Code:
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/FiltersFeature.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/menu/ListMenu.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/menu/RangeMenu.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/BooleanFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/DateFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/ListFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/NumericFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/StringFilter.js">
    <script type="text/javascript" src="your/path/to/extjs4/examples/ux/grid/filter/Filter.js">
    Maybe you have some problems with your paths.
    Did you get any example working on your system? Did you get your app working without filters? How does it look your index.html? Maybe you can post your code and a screenshot of your project folders.
    I don't think that the problem is between your php framework and the Loader. And try to use ExtJS 4.1.1, since there are a lot of changes in the filter classes and a lot of bugs are fixed.
    First I would like to thank you for your time and knowledge

    Win 7 Ext JS 4.1.3 IE(6-9), FF17

  9. #8
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Thanks, msinn!
    I found out the same solution for me in between and replied it here, but I got a message from the Forum, that my posting will be observed by an moderator ...
    It's not possible for me to switch to 4.1.1 with this project :-(
    new to ExtJS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •