extjs4.1 - How to insert records for particular store field in extjs -


i getting month, target, target1 values getting webservice available in store. want calculate total value , insert total field value in same store.

i doing calculation don't know how insert total value total field. can tell me how this?

chartstore.each(function (rec) {                        total=parsefloat(rec.get('target'))+parsefloat(rec.get('target1')); }); 

month target target1   total   jan    25     25       50  mon    50     50       100 

you should use convert function in model total field below

     {         name : 'total',         convert : function( value, record ) {                        var totalvalue = record.get('target') + record.get('target1');                        return totalvalue;         }            type: 'number'     }, 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -