PDA

View Full Version : MVC - Views, Controller & Model



managedfollowup
7 Dec 2011, 3:00 AM
Hi all,

I'm looking at ext4. I have a few questions that I need to clear up before committing to using it in anger. As follows:

I have index.html and do not want to use viewpoint. I wish to have container to allow strolling. So my app.js does such. I can load a few custom views via controllers into items[] - sorted! My question is when I want to go to another page. Do I create Dashboard.html and dashboard.js (instead of app.js). or do I render a controller into an existing container? Basically, do I make the app only load one page for my main site?

Controller & Model. When a user clicks a button after filling in form data, an event on the controller gets fired (got this working!) Now, I would expect that you could get a reference to the model content, in turn I would expect that Model to call a proxy, voila! But I cannot seams to get a handle to the model content. using 'this.getUserXYZ' gets me a function? any ideas? However, I can get a reference to the form but it just doesn't feel right if ext4 MVC is actually MVC?

Cheers

mitchellsimoens
9 Dec 2011, 9:03 AM
You can have multi page applications except you will have the browser redownload everything which isn't optimal and not very RIAish IMO. Instead, you could add/remove components to act as different pages.

For your form, do you use loadRecord onto the basic form and pass a model instance? If so, then you can use the getRecord and updateRecord methods.

Also, please post into the appropriate forum. I have moved this to the Ext JS 4 Q&A forum for you.