0

I have this code that iterates over tasks:

Ext.Array.each(data, function(task) {
    var t  = {
        FormattedID: task.get('FormattedID'),
        Name: task.get('Name'),
        Estimate: task.get('Estimate'),
        Owner: task.get('Owner')._ref,
    };
}

I can get it print /user/1234

but this does not work:

Owner: task.get('Owner').UserName
4

1 回答 1

0

You may use task.get('Owner')._refObjectName as in the code fragment below:

Ext.Array.each(data, function(task) {
                            var t  = {
                                FormattedID: task.get('FormattedID'),
                                Name: task.get('Name'),
                                Estimate: task.get('Estimate'),
                               Owner: task.get('Owner')._refObjectName
                            };
于 2013-08-05T16:07:54.117 回答