View Full Version : how to access custom class

6 Sep 2012, 7:51 PM
hi, new to sencha here. i have some predefined javascript functions e.g.

function getString() {

placed it under model/myfolder/test.js

and within a view javascript file, i want to call and get the value of getString() in test.js

i tried to use ext.requires , it does not work

i tried to instantiate it like
var t = Ext.create('MyProj.model.myfolder.test');

but it looks like it does not work still

is this even possible?

6 Sep 2012, 10:51 PM
You should include your script file by using <SCRIPT> tag embedded in HTML file.

6 Sep 2012, 10:57 PM
ive read that putting it within the index.html is not advisable.

however, i managed to find a solution. place it in the app.json

"js": [
"path": "myfolder/myjs.js"

though i am wondering. if the myfolder has many .js files and iw ant to import all of them, does that mean i have to add an entry of "path": "myfolder/myjs1.js" 1 by 1?

6 Sep 2012, 11:09 PM
It seems that this is your own solution. I don't know how it work so it's hard to give out a suggestion.

6 Sep 2012, 11:12 PM
actually this is not my solution, but one that was discussed in the docs. thank you for replying though

7 Sep 2012, 9:08 AM
Please have a look at: