1

I am using websql as store's proxy in Sencha Touch. I need to use filter on a store as well as the data in the store has to be saved in the web sql database. The data is set in the database but the filter is not working. I have also tried remoteFilter but it is of no help. Following is the code snippet:

Ext.define('MyApp.store.DummyStore', {
extend: 'Ext.data.Store',

config: {
    model: 'MyApp.model.DummyModel',
    proxy: {
        type: 'sql',
        database: 'MyApp',
        table: 'Data',
        writer: {
            type: 'json'
        }
    }
  }
});

Ext.define('MyApp.model.DummyModel', {
extend: 'Ext.data.Model',
config: {
    fields: [{
        name: 'firstname'
    }, {
        name: 'lastname'
    }]
  }
});

Ext.define('MyApp.controller.App',{
extend:'Ext.app.Controller',
config:{
    refs:{
        view:'view'
    },
    control:{
        view:{
            initialize: 'filterStore'
        }
    }
},
filterStore: function() {
    var me=this;
    Ext.getStore('DummyStore').filter('firstname','abc', true);
  }
});

Any help or suggestion will be appreciated. Thanks

Tarabass
  • 3,132
  • 2
  • 17
  • 35
Ipsita Roy
  • 11
  • 1
  • What do you mean by web sql? Sqlite database or the web version of mssql? – Tarabass Aug 25 '15 at 10:58
  • @Tarabass, It is the Sencha sql proxy. Sencha uses websql, Ext.data.proxy.Sql – Ipsita Roy Aug 25 '15 at 11:04
  • Do you get any data out of it? Any errors in devtools of Chrome? Does the store even load at all? – Tarabass Aug 25 '15 at 11:09
  • In your example, you didn't add `storeId,autoload` property. Does in the the list is even showing any data? Have you tried calling ` Ext.getStore('DummyStore').load();` after filtering it? – Sagar Khatri Sep 03 '15 at 05:42

0 Answers0