-
6 Sep 2012 7:51 PM #1
Unanswered: how to access custom class
Unanswered: how to access custom class
hi, new to sencha here. i have some predefined javascript functions e.g.
test.js
function getString() {
alert('sample');
}
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 #2
You should include your script file by using <SCRIPT> tag embedded in HTML file.
-
6 Sep 2012 10:57 PM #3
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
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?Code:"js": [ { "path": "myfolder/myjs.js" }, ],
-
6 Sep 2012 11:09 PM #4
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 #5
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 #6Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433


Reply With Quote