ExtJS remote filtering - determine filter data type on the server side -


I am implementing remote filtering in gridpell in my ExtJS MVC application. The client sends the simplified filter to the server correctly, but unfortunately on the server I am not able to determine which type of data is filtered I am currently receiving JSN data in this format:

For example:

  [[\ "operator \": \ "gt \", \ "value \": 1412114400000, \ "property \": \ [ [\ "\" \ N \ n \ n \ n \ n \ n \ n \ n \ n Operators \ ": \" gt \ ", \" value \ ": 1412114400000, \" attribute \ ": \ "Expiration date \", \ "data type \": \ "date \" "}]  

This model is

  Ext.define (expand, 'covovuthmweb.model.UtenteModel': 'Ext.data.Model', field: [{name: 'ID' }, {Name: 'isAprproved'}, {name: 'Userid'}, {name: 'UserName'}, {name: 'password'}, {name: 'email'}, {name: 'comment}}, {name: 'isLockedOut'}, {name: 'IsOnline'}, {name: 'ExpirationDate'}, {name: 'LastActivityDate'}, {name: 'CreationDate'}, {name: 'LastLockoutDate'}, {name : 'LastLoginDate'}, {name: 'LastPasswordChangedDate'}, {name: 'BloccatoChanged', defaultValue: true}], idProperty: 'ID'});  

The store looks like this:

  Ext.define ('covovautweb.store.UtenteStore', {extension: 'Ext.data.Store', AutoSync: false, remoteFilter: true, remoteSort: requires: [ 'CGovAuthWeb.model.UtenteModel'], model: "CGovAuthWebkmodelkUtenteModel ', StoreId:" Utente ", Pejasistm 15, proxy: {type: rest' URL: 'API / Utent' Reader: {type: 'Jason', root Propriti: 'results' message properties' message' Total properties: 'Total', Aideeporfti: 'id', success properties' success '}, Author: {type:' jason ', writefield: truth}}});  

The following code fragment is the column in the gridpanel:

  {flex: 2, header: 'scadenza', datindex: 'expiration date', editor: { Type: 'date'}},  

Any suggestion really is: {xtype: 'datefield', allowBlank: true, format: 'd / m / y',}, filter : {Type: 'date'}}.

Defining these two overrides in the override folder is a good solution to the problem.

  Ext.define ( 'Ext.override.grid.filters.filter.Base', {override: 'Ext.grid.filters.filter.Base', createFilter: function (config, key ) {Var me = this, filter = me.callParent (argument), type = me.getInitialConfig ('type'); filter.type = type; return filter;}}); Ext.define ( 'Ext.override.util.Filter', {override: 'Ext.util.Filter', Getstet: function () {var me = this, state = this.callParent (logic); if (me.) {State.type = me.type;} Return Status;}});  

After this amendment it is necessary to refresh an application with the Sencha CMD. Run the command in the application root folder:

  sencha app refresh  

Thanks so much for the support team!


Comments