Results 1 to 3 of 3

Thread: Dividing code , rather than writing it all inline

  1. #1

    Default Dividing code , rather than writing it all inline

    hey guys,

    i have been writing all my code inline within a single page, whether it be grids or accordions or anything, now i want to write code such that my grid is another page and accordions in another and then access them in one page. how do i achieve this, i 'd appreciate an example

    regards

    ice

  2. #2
    Touch Premium Member
    Join Date
    Sep 2008
    Location
    Orange County, CA, USA
    Posts
    186

    Default

    <script type="text/javascript" src="/js/ext1.js"></script>
    <script type="text/javascript" src="/js/ext2.js"></script>
    <script type="text/javascript" src="/js/ext3.js"></script>

    ExtJS is valid javascript. You can specify
    Code:
    Ext.onReady(function(){
        alert("test");
    });
    in multiple pages.

    Your big issue is making sure everything is instantiated/created before you start a script that attempts to coordinate behaviors. Might want to delay adding listeners until you are in the last script, i.e.

    myPanel.on('render',function(){...});

  3. #3

    Default

    thanks a lot man

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •