Results 1 to 2 of 2

Thread: Store field convert function not updating the value

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jul 2009
    Austin, TX
    Vote Rating

    Default Store field convert function not updating the value

    I'm trying to use a convert function and it isn't working for some reason. The code looks like this:
                            {name:'provider_display_name',convert: function(v,record){
                                try {
                                    var retval = '', json;
                                    if (!Ext.isEmpty(record.resource_provider_json)){
                                        if (Ext.isString(record.resource_provider_json)){
                                            json = Ext.util.JSON.decode(record.resource_provider_json);
                                        } else {
                                            json = record.resource_provider_json;    
                                    if (Ext.isEmpty(json)){
                                        if (!Ext.isEmpty(record.labor_provider_json)){
                                            if (Ext.isString(record.labor_provider_json)){
                                                json = Ext.util.JSON.decode(record.labor_provider_json);
                                            } else {
                                                json = record.labor_provider_json;    
                                    if (!Ext.isEmpty(json) && !Ext.isEmpty(json.display_name)){
                                        retval = json.display_name;
                                    return retval;
                                    return '';
    I can do a console.log of retval before returning it and it is getting set. But in the record that loads in the grid the value is undefined. Can anyone tell me what I'm doing wrong?
    Last edited by slsmithtx; 8 Nov 2012 at 4:53 PM. Reason: Misspelling in the title

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Vote Rating


    Would you be able to give an example of what an example record would look like?

    It seems as though each of your record field values could contain JSON, which in itself seems a little out of the ordinary.

    With an example record showing what data you expect to receive then I could knock up an example and try to work out what's going wrong.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts