I've got a interesting situation. I've got a controler with the call
Todo.Models.PersonAddress.findAll({
personId:personId
}, this.callback('list'));
In the model we've got:
findAll: function( params, success, error ){
$.ajax({
url: '/person/get-address-json',
type: 'post',
dataType: 'json',
data: params,
success: this.callback(['wrapMany',success]),
error: error
});
},
Theses work just perfect. However I'd like to change my model to bring a JSON string that I already have in my current code.. It'd look like:
findAll: function( params, success, error ){
var source = jQuery.parseJSON($('#address-personData').val());
var person_addresses = this.wrapMany(source);
this.callback(person_addresses, success);
}
But the callback() doesn't work at all and doesn't give any error ou notice. Could any one help me with that issue? All I want is just bring the same information as the one with $.ajax.