How to acces Object property

2019-08-26 06:20发布

I have external API, proxy is rest, reader defined, type: 'json', rootProperty: 'data;

How to get property "FullName" I have tried with record.get('FullName').

Created function called getDetails, passed as argument string, returned return record.get('FullName), always undefined.

 Details: function(v, record) {

       return record.get('FullName') 
    }

Here is onDelete function :

OnDelete: function (record,data) {
     Ext.Msg.confirm('Delete Changes', 'Do you want to delete' + " " + record.Details, function (choice) {

            if (choice === 'yes') {
                var store = Ext.getStore('store.Personnel');
                store.remove(record);
                store.sync();

            }
        })
    },

this is how console log on record look like. I have 3 constructors with Id's then data, and then obj properties)

标签: Extjs
1条回答
一夜七次
2楼-- · 2019-08-26 06:46

You should use record.get('FullName') like:

OnDelete: function (grid, rowId) {
    var record = grid.getStore().getAt(rowId);
        Ext.Msg.confirm('Delete Changes', 'Do you want to delete' + " " + record.get('FullName'), function (choice) {
            if (choice === 'yes') {
                var store = grid.getStore();
                console.log(store)
                store.remove(record);

            }
        })
    }

Your example on fiddle: https://fiddle.sencha.com/#view/editor&fiddle/2ttb

查看更多
登录 后发表回答