1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default 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?

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    You should include your script file by using <SCRIPT> tag embedded in HTML file.

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default


    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
    Code:
    "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?

  4. #4
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    It seems that this is your own solution. I don't know how it work so it's hard to give out a suggestion.

  5. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
    chitgoks is on a distinguished road

      0  

    Default


    actually this is not my solution, but one that was discussed in the docs. thank you for replying though

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,085
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

Thread Participants: 2

Tags for this Thread