PDA

View Full Version : examples/app/simple does not work without changes



notcourage
30 May 2011, 8:47 PM
I'm a rookie so sorry if this isn't ideal.

To avoid classes not loading:

simple.html
Replace:
<script type="text/javascript" src="../../../builds/ext-core.js"></script>
<script type="text/javascript" src="classes.js"></script>
with:
<script type="text/javascript" src="../../../ext-all-debug.js"></script>

app.js
Add to top:
Ext.Loader.setConfig({enabled:true});

To avoid same origin exception:

store/Users.js
Replace:
type: 'ajax',
with:
type: 'memory',
data:
{
success: true,
users: [
{id: 1, name: 'Ed', email: '[email protected]'},
{id: 2, name: 'Tommy', email: '[email protected]'}
]
},

ext-4.0.1/docs/index.html#/guide/application_architecture
implied ajax would work locally.

controller/Users.js
refs: [
{
ref: 'usersPanel',
selector: 'panel'
}
],
What's this mean?

In a real app, what goes in onReady()?

ext-4.0.1/docs/index.html#/guide/getting_started
I can't find the command line utility "sencha" in the distribution.

mberrie
31 May 2011, 3:41 AM
<script type="text/javascript" src="../../../builds/ext-core.js"></script>


Definitely a bug (maybe in the build tools?). Another possible fix (instead of using loader) is:



<script type="text/javascript" src="../../../bootstrap.js"></script>



I agree that the simple.html file should also showcase how to use Ext.Loader and individual source files. For sb new to Ext it might not be immediately obvious that the file references the minified classes.js instead of the source files in the src directory. Could be improved. However, the Getting Started Guide (http://docs.sencha.com/ext-js/4-0/#/guide/getting_started) mentions this AFAIK.



ext-4.0.1/docs/index.html#/guide/application_architecture
implied ajax would work locally.


You are referring to the screenshots showing the server address as 'ed.local'?

Well, I guess this misunderstanding is thanks to chrome omitting the protocol identifier (http://) for 'better usability ;)

I don't think the examples are meant to be run from the file system without a web server. But I could be wrong.




controller/Users.js
refs: [
{
ref: 'usersPanel',
selector: 'panel'
}
],
What's this mean?


This is explained in the docs for Ext.app.Controller: http://docs.sencha.com/ext-js/4-0/#/api/Ext.app.Controller



In a real app, what goes in onReady()?


That depends on your app's architecture. If you use Ext4's MVC framework you don't necessarily require any custom initialization code in Ext.onReady anymore, since the framework will listen to that event and setup your app according to your MVC definitions.




ext-4.0.1/docs/index.html#/guide/getting_started
I can't find the command line utility "sencha" in the distribution.

Did you see the SDK tools download link on the ExtJS product page?
http://www.sencha.com/products/extjs/

notcourage
31 May 2011, 4:06 PM
Foolishly, I didn't realize the SDK is something different from extjs4.

"ref" is defined in simple but I don't see it used.

Trying to eliminate red triangle in cells. Adding to updateUser(button):
this.getUserModel().commit();
causes an error.

notcourage
1 Jun 2011, 1:11 PM
I posted the answer here:
http://www.sencha.com/forum/showthread.php?133767-Store.sync()-does-not-update-dirty-flag&highlight=commit