The fastest easiest way to get it right.

buttonStandard

NAME

x6plugins.buttonStandard

FUNCTION

The Javascript method buttonStandard gives a button object the standard behavior of responding to a single keystroke and responding to enable/disable commands.

Use this function when you create a custom button to put onto the screen.

A custom button requires a uniquely named 'action' and a hotkey. Actions reserved by andromeda are:


  • duplicate
  • new
  • remove
  • save

EXAMPLE

A custom button is created in PHP code like so:

    <?php
    # option 1, straight html
    

    # option 2, or a link
    $div = html('div');
    $a = $div->h('a-void','My Action');
    $a->hp['x6plugIn'] = 'buttonMine';
    $a->hp['x6table'] = 'example';  // only if relevant
    ?>

Then you define a javascript x6plugIn that includes a single function, main(), which is called when the button is enabled and is clicked or the hotkey is pressed.

     <script>
     x6plugins.buttonMine = function(self,id,table) {
         // the first line activates normal behavior,
         // replace the values in this line with those
         // appropriate to your button.
         x6plugins.buttonStandard(self,'save','CtrlS');

         // Then create the main function
         self.main = function() {
            // fire off some event
         }
     }
     </script>

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2