PDA

View Full Version : Default Touch MVC App is not working



BmanVT
1 Sep 2011, 12:32 PM
I generated the MVC structure using the jsbuilder tools in Sencha 1.1.0 distribution.

To generate I did the following.
a) Created a sencha.bat file with this content:
@echo off
set dir=%~dp0
%dir%jsdb\win\jsdb.exe -path %dir% %dir%bin\Dispatch.js %*

b) I used a command line to generate and app strucure and seeemed to generate OK, though I did not see and index.html file.

c) I added an index.html file that loads touch library, style sheet and, app.js

When app.js starts it (Chrome) throws error

Uncaught TypeError: undefined is not a function
BookList1.Ext.Application.launchapp.js:11
Ext.Application.Ext.extend.onBeforeLaunchsencha-touch.js:6

for this line:
this.viewport = new BookList1.Viewport();

No code has been written by my except the index.html page.

Any insight into how to fix this would be appreciated.

BmanVT
6 Sep 2011, 11:18 AM
Found this issue and resolved it; had to do with how the index.html file is constructed; however, there are more errors in the generated javascript from the JSBuilder which is very sad. Required configuration object elements are missing all over the place.

This is pretty poor.
I have instead used a blog example from here:

http://myxaab.wordpress.com/2011/02/27/sencha-touch-mvc-application-part-2/

I wish there would be better out of the MVC examples from Sencha and the delivered code would actually work. Instead I have only found out of context code snippets after several weeks of searching.
Definetly an area of improvement if people are expected to pick this up and use it. Instead this drives you to other funcitoning JS MVC frameworks.