2

我的读者:

var reader = new Ext.data.JsonReader({
     totalProperty: 'total',
     successProperty: 'success',
     idProperty: 'id_k',
     root: 'rows',
     messageProperty: 'message'  // <-- New "messageProperty" meta-data }, [
     {name: 'id_k'},    {name: 'nm_kb', allowBlank: false},
     {name: 'id_p'},    {name: 'nm_p', allowBlank: false} ]);

我的专栏:

{header: "Provinsi", width: 100, sortable: true, dataIndex: 'id_p'}

如何使 dataIndex: 'id_p' 显示为 'nm_p' 但仍然 dataIndex: 'id_p'?

我希望它显示“nm_p”....

谢谢...

4

1 回答 1

5

在列上使用渲染器:

var Provinsi = {
   header: 'Provinsi',
   dataIndex: 'id_p',
   renderer: function(value, metaData, record, rowIndex, colIndex, store) {
      return record.data.nm_p;
   }
}

链接到文档

于 2012-11-14T10:53:28.940 回答