Results 1 to 3 of 3

Thread: I can't to filter items in a dataStore for gridPanel... I need yor help

  1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    20

    Default I can't to filter items in a dataStore for gridPanel... I need yor help

    Thanks to your help I continued searching how to fix my problem to render the gridpanel from treepanel when I select a node. Finally I solved it using the add method (MyPanel_01.add (grid) in the panel. My problem now is finding a way to filter the contents of grid considering the value of two variables that captured when selecting a node in the tree panel

    Code:
    var a = record.parentNode.raw.name;
    and

    Code:
    var b = record.raw.name;
    My questions are:

    1. I can load the datastore using a PHP filter to give me the coincidences in Json format?

    2. Or is it better to filter the records from the same datastore and load matches in the grid?

    Here is my Model and dataStore:
    Code:
    Ext.define('MigrInterna', {
            extend: 'Ext.data.Model',
            fields: [
                      {name:'Pais', type: 'string'},
                      {name:'DivPola', type: 'string'},
                      {name:'Archivo',  type: 'string'},
                      {name:'Etiqueta',  type: 'string'}
     
     
                    ],
        });
     
     
        // create the Data Store
        var store_Tabs = Ext.create('Ext.data.Store', {
            storeId: 'MigrIntStore',
            model: 'MigrInterna',
            remoteGroup: true,
            buffered: true,
            leadingBufferZone: 300,
            pageSize: 100,
            proxy: {
                type: 'ajax',
                url: 'SeleccionDeArchivos.php',
                reader: {
                    type: 'json',
                    root: 'MigrInt'
                },
                simpleSortMode: true,
                simpleGroupMode: true,
     
     
                groupParam: 'sort',
                groupDirectionParam: 'dir'
            },
            sorters: [{
                property: 'title',
                direction: 'ASC'
            }],
            autoLoad: true,
            listeners: {
     
     
                groupchange: function(store, groupers) {
                    var sortable = !store.isGrouped(),
                        headers = grid.headerCt.getVisibleGridColumns(),
                        i, len = headers.length;
                    
                    for (i = 0; i < len; i++) {
                        headers[i].sortable = (headers[i].sortable !== undefined) ? headers[i].sortable : sortable;
                    }
                },
     
     
                beforeprefetch: function(store, operation) {
                    if (operation.groupers && operation.groupers.length) {
                        delete operation.sorters;
                    }
                }
            }
        });
    I have searched and tried to do from many examples but I don't found any result, I would appreciate if you can give me further assistance.

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579

    Default

    Hi,

    Since you're already using a buffered store with remote grouping, you can use the remoteFilter config option and handle the filtering on the server prior to sending the response.

    http://docs.sencha.com/extjs/4.2.3/#...g-remoteFilter

    Hope this helps,
    Tristan

  3. #3
    Sencha User
    Join Date
    Aug 2013
    Posts
    20

    Default

    Hi Tristan,Thank for your answer and suggestion, I will test and will comment about de result.

Similar Threads

  1. How to filter datastore
    By ks2009 in forum Ext: Q&A
    Replies: 1
    Last Post: 16 Nov 2011, 12:08 AM
  2. DataStore filter: How to refresh grid after filter applied?
    By Tumac in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 8 Nov 2010, 9:08 AM
  3. Datastore set Filter before loading
    By ballibum in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 21 Aug 2009, 6:11 AM
  4. DataStore filter not being applied to comboxbox
    By MikeyH in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 24 Jun 2008, 5:56 AM
  5. datastore filter event
    By JanDV in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 6 Mar 2008, 3:14 PM

Tags for this Thread

Posting Permissions

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