2013-09-26 2 views
0

У меня есть поле со списком, который прослушивает в магазинзначения ComboBox ExtJs Tranlsated

 { 
           id: 'filterOrderStatus', 
           xtype: 'combobox', 
           fieldLabel: Translation.MailboxListStatus, 
           store: 'DocumentStatuses', 
           displayField: 'name', 
           valueField: 'id', 
           itemId: 'filterOrderStatus', 
//        flex: 1, 
           height: 23, 
           labelWidth: 45, 
           width: 130, 
           cls: 'filterInputField', 
           listConfig: { 
            cls: 'comboboxlist-sizefit' 
           } 

Магазин простой Аякса магазин, который retrives значения. nwo мне нужно преобразовать значения, которые он получает на другой язык, как я могу это сделать? здесь магазин:

Ext.define('xxx.xx.xxx', { 
    extend: 'Ext.data.Store', 
    requires: 'xxx.xxx.xx', 
    model: 'xxx.xxx.xxxx', 

    autoLoad: true, 

    proxy: { 
     type: 'ajax', 
     api: { 
      read: ConfigurationData.url + 'xxx.php?xx=xx&xx=xxx' 
     }, 
     reader: { 
      type: 'json', 
      root: 'results', 
      successProperty: 'success' 
     } 
    } 
}); 

ответ

1

В модели можно вернуть преобразованный запись непосредственно, как показано

{ 
    name : 'name', 
    convert : function(value, record) { 
       //Your logic to convert the old name(value) into new name. 
       return name; 
    } 
    type: 'string' 
}, 
Смежные вопросы