PDA

View Full Version : [FIXED] Model Save



jochen.schoellig
14 Nov 2011, 7:35 AM
Hallo,

i get always a failure when i try to save something in my model.



onNodeSelect:
function(list, node) {
console.log('onNodeSelect');
console.log(node);
node.set('name', 'test');
node.save({
success: function() {
console.log('erfolgreich');
}
});
},


TypeError: 'true' is not a valid argument for 'in' (evaluating ''listeners' in config')

Please help

Jamie Avins
14 Nov 2011, 9:52 AM
Can you provide how your Model/Store is configured.

jochen.schoellig
14 Nov 2011, 10:41 AM
Here are more Details...

Model:


Ext.define('Homie.model.Room', {
extend : 'Ext.data.Model',
requires: 'Homie.model.Node',

fields: [
{ name: 'id', type: 'int' },
{ name: 'name', type: 'string' },
{ name: 'type', type: 'string' },
{ name: 'count', type: 'int' }
],

hasMany: {
model: 'Homie.model.Node',
name : 'nodes'
},

proxy: {
type : 'rest',
url : apiUrl + 'rooms',
reader: 'json'
}
});


Store:


Ext.define('Homie.store.Rooms', {
extend : 'Ext.data.Store',
requires: 'Homie.model.Room',
model : 'Homie.model.Room',

autoLoad: true
});


Controller:


...

onRoomSelect: function(list, room) {
console.log('onRoomSelect');
console.log(room);

room.set('name', 'test');

room.save({
callback: function() {
console.log('erfolgreich');
}
});
}
...

Jamie Avins
14 Nov 2011, 10:47 AM
Great, thank you for the report.

TommyMaintz
16 Dec 2011, 12:29 PM
This will be fixed as part of the next Touch 2.0 release. Thanks for the report.