1. #1
    Sencha User
    Join Date
    Jan 2013
    Location
    Colombia
    Posts
    7
    Vote Rating
    0
    HEILEENDURLEY is on a distinguished road

      0  

    Default Unanswered: Filter by default value in a column

    Unanswered: Filter by default value in a column


    Hi everyone!!

    I was using extjs 3x and i use following code for filter default in a column:

    C:
    Code:
    dsGrid = new Ext.data.GroupingStore({
                        reader: dsReader,            
                        proxy: dsProxy,                    
                        baseParams:        {app: 'myApp', module:  "myModule", action: "myAction", filter:  '[{"type":"list","value":["Activo"],"field":"estado"}]'},
                        remoteSort:     true
                    });

    In the above code the first data load brought me the records that were consistent with the status = 'Active'. But i later put another value in column of status he show me the other values=newValue.

    But int Extjs 4x i cant find the same functionality.

    Try using the store.filter
    Code:
    this.storeBase.filter('estado', 'Activo');
    But does not help because if filter column the value='Activo' persist dont change. Is the same filter for everything and i dont want thereby.

    Someone can help me?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So you want to use the same thing as baseParams from Ext JS 3? In Ext JS 4, you set the extraParams on the proxy.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Location
    Colombia
    Posts
    7
    Vote Rating
    0
    HEILEENDURLEY is on a distinguished road

      0  

    Default


    I have the folowwing config for Ext.data.Store:

    Code:
    factoryBaseProxy: function(modelName, url, readerType, apiRead, apiCreate, apiUpdate, apiDestroy){
                readerType = ( readerType == null ) ? readerType = "json" : readerType;
                
                return {
                    model: modelName,
                    autoLoad: true,
                    autoSync: true,
                    proxy: {
                        type: 'ajax',
                        api: {
                            read: url + ((apiRead == null)? 'listAll' : apiRead),
                            create: url + ((apiCreate == null)? 'insert' : apiCreate),
                            update: url + ((apiUpdate == null)? 'save' : apiUpdate),
                            destroy: url + ((apiDestroy == null)? 'delete' : apiDestroy)
                        },
                        reader: { type: readerType, root: 'data', successProperty: 'success', messageProperty: 'message', totalProperty: 'total' },
                        writer: { type: 'json', root: 'data', writeAllFields: true },
                        listeners: {
                            exception: function(proxy, response, operation){
                                
                                json = Ext.JSON.decode(response.responseText);                                     
                                if( json.message!=null && json.message!='' )                                                                           
                                    Ext.Msg.alert('REMOTE EXCEPTION', json.message);                                                                                
                                
                                Ext.MessageBox.show({
                                    title: 'REMOTE EXCEPTION',
                                    msg: operation.getError(),
                                    icon: Ext.MessageBox.ERROR,
                                    buttons: Ext.Msg.OK
                                });
                                
                                if( operation.action == 'create' )
                                    this.storeBase.remove( operation.records[0] );
                            }
                        }
                    },
                    //sorters: {property: 'errocons', direction: 'ASC'},
                    // groupField: 'errousge', // SI SE DESEA Q SE AGRUPE AL INICIAR
                    remoteSort: true,
                    pageSize: CONST_MAX_ROWS
                };
            }
    where can i put the base params?

Thread Participants: 1

Tags for this Thread