Results 1 to 5 of 5

Thread: Multiple Hello World boxes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Jul 2007
    Location
    Calgary, AB
    Posts
    10

    Default Multiple Hello World boxes

    Is there a way to use the Hello World javascript, but modify it so that it will load if you have multiple buttons. Right now it will only load on my first button.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    Did you wire the click event for each button you added?

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Quote Originally Posted by tryanDLS View Post
    Did you wire the click event for each button you added?
    some folks are new to javascript. I am learning more and more each day and this makes sense to me. but for newbs it may not. :-\

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Calgary, AB
    Posts
    10

    Default

    I'm looking for a scalable solution, because I am pulling records from a database. Each record would have a button associated with it, and the buttons ID will be generated automatically. so it would be button1 button2 button3 and so on.

    I don't need multiple instances of the dialog box, they can all reference the same one, the problem is that only 1 button works at this time, looking for code to make them all work.

    I will try the code you supplied when I get home tonight and let you know how it goes, looks like it may work

    Thanks.

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Quote Originally Posted by dillenger View Post
    Is there a way to use the Hello World javascript, but modify it so that it will load if you have multiple buttons. Right now it will only load on my first button.
    I hope i understand what you're looking to do.

    PHP Code:
    // Add  your own buttons, attach a handler
        
    myBtn = new Ext.Button('myBtn', {
            
    text"My Button",
            
    handlerHelloWorld .showDialog
        
    });
    // OR
    // or existing buttons or elements
                 
    showBtn1 Ext.get('showBtn1');
                 
    // attach to click event
                 
    showBtn1.on('click'HelloWorld .showDialog);

                 
    anyElem Ext.get('myElement');
                 
    // attach to click event
                 
    anyElem .on('click'HelloWorld .showDialog); 

Posting Permissions

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