PDA

View Full Version : upDateWithRecord is not working within MVC application



erwin85
27 May 2011, 7:12 AM
I used the tutorial from building a MVC application with PhoneGab to build my app. Now I tried to update a page with the function updateWithRecord. In my view I have a list with a onItemDisclosure eventlistener.



onItemDisclosure: function (record) {
Ext.dispatch({
controller: app.controllers.controller,
action: 'showMap',
data: record.data
});
}

In the Controller I'm listening to this event:


showMap: function(options) {
var data = options.data;
console.log(data);
app.views.Detail_fund.updateWithRecord(data);
app.views.viewport.setActiveItem(
2, options.animation
);
}

As you can see It will open a view with the ID of 2. That wil work but I got an error with the update event: Uncaught TypeError: Object function (){ superclass.apply(this, arguments); } has no method 'updateWithRecord'

In my Detail_fund view class I just have a log:


updateWithRecord: function(record) {
console.log("gelukt!");
}


Why Is this not working?

erwin85
6 Jun 2011, 1:12 AM
Please help me with this. I can't get this fixed.

jamesgpearce
6 Jun 2011, 7:52 AM
updateWithRecord is not a function of the Sencha Touch API - it was created for that tutorial as part of the sample app.

So it's possible that you've copied some of the app code from that article but not all of it?

The Sencha Touch method you need is .update() and I recall the purpose of the .updateWithRecord() method was just to make sure that former method got called on all the child panels.

James