javascript - Sencha app build native overwriting our custom code -
we have been working in application quite time developed using sencha touch 2.
we test , debug code using chrome , ripple.
the problem facing added custom search , grouping logic 1 of our lists views. when tested , debugged using chrome worked expected, used command package in order integrate cordova , generate android , ios applications. used following command:
sencha app build native
for reason, code generated command overwriting our custom search , grouping javascript code.
why happening. thing not sencha tool not working correctly rather doing wrong causing happen.
we clueless on reason be. can throw light this? why our custom grouper , filtering functions being overwritten when packaging application?
bellow extract on how define grouping method in our store. again, when try in our debug environment works correctly. problem when package using above command, grouper function gets replaced default sencha touch 2 grouping function returns first character of string.
ext.define('app.store.definitions',{ extend:'ext.data.store', requires: [ 'ext.data.connection' ], config:{ fields: ['id','name', 'description'], sorters: 'name', grouper: function(record) { // these translation arrays var accents = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛ"; var desiredvalue = "aaaaaeeeeiiiioooouuuu"; // first upercase first character of name var firstchar = record.get('name').touppercase()[0]; //next check if special character checking position in accents string var n = accents.indexof(firstchar); // if character in accents (means special character) corresponding normal character if (n <> -1) { firstchar = desiredvalue.charat(n); }; // , return value ad grouping value return firstchar; }
after executing "sencha app build native" , decompresing generated code realize grouper function has been replaced
grouper: function(record) { var firstchar = record.get('name`); return firstchar; }
i tested native build on 1 of apps grouper , doesn't replace code. think need specify groupfn paramater inside of grouper object literal. see following example:
ext.define('app.store.definitions',{ extend:'ext.data.store', requires: [ 'ext.data.connection' ], config:{ fields: ['id','name', 'description'], sorters: 'name', grouper: { groupfn: function(record) { // these translation arrays var accents = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛ"; var desiredvalue = "aaaaaeeeeiiiioooouuuu"; // first upercase first character of name var firstchar = record.get('name').touppercase()[0]; //next check if special character checking position in accents string var n = accents.indexof(firstchar); // if character in accents (means special character) corresponding normal character if (n <> -1) { firstchar = desiredvalue.charat(n); }; // , return value ad grouping value return firstchar; } }
Comments
Post a Comment