View Full Version : Sorting store with SQL proxy

8 Jun 2016, 10:10 AM
What is the proper way to sort a store that has a proxy set as SQL? I am trying to sort a store by a string field while ignoring case. To do this I have added a sorter with a transform function that transforms the string to all lower case. When the proxy type is set to sql this function isn't called. Setting the proxy type to localstorage and this function is called and the list is sorted correctly.

I would prefer to use a sql proxy vs a localstorage proxy since this is for a cordova app and according to this page https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html localstorage may be cleared by the operating system under iOS.

I have created a fiddle to demonstrate the issue https://fiddle.sencha.com/#fiddle/1bog

Gary Schlosberg
8 Jun 2016, 1:37 PM
I think this could be a timing issue. Here's a Touch thread with a related discussion.

9 Jun 2016, 5:34 AM
Adding the override

Ext.define('Vetapp.override.data.proxy.Sql', {
override: 'Ext.data.proxy.Sql',
isSQLProxy: false

to my app and the sorting is now working.

Gary Schlosberg
9 Jun 2016, 5:43 AM
Glad to hear it, and thanks for sharing your override with the community.