This is a button widget, that can render buttons, for use in other widgets
Mikkel Bergmann, http://www.pointful.com
| pax. | This is a button widget, that can render buttons, for use in other widgets |
| Functions | |
| pax. | Renders a button into the given target |
pax.widget.button.init = function( target, args )
Renders a button into the given target
| target | an element to render the button into |
| args | arguments for the grid widget |
Button widget object
<span id='widget.button.init.example1'></span>
[:.
pax.widget.button.init( pax.$('widget.button.init.example1'), {
id: 'myButton',
content: 'Hello!',
func: function(e){ alert('Hi!') }
} );
:]<span id='widget.button.init.example1.but1' style='float:left'></span>
<span id='widget.button.init.example1.but2' style='float:left'></span>
<span id='widget.button.init.example1.but3' style='float:left'></span>
<span id='widget.button.init.example1.but4' style='float:left'></span>
[:.
pax.widget.button.init( pax.$('widget.button.init.example1.but1'), {
func: function(e) { alert( 'you clicked button 1.' ); },
content: '<img src="/pax/resource/img/arrow_left_full.gif">',
width: '18px'
} );
pax.widget.button.init( pax.$('widget.button.init.example1.but2'), {
func: function(e) { alert( 'you clicked button 2.' ); },
content: '<img src="/pax/resource/img/arrow_left.gif">',
width: '18px'
} );
pax.widget.button.init( pax.$('widget.button.init.example1.but3'), {
func: function(e) { alert( 'you clicked button 3.' ); },
content: '<img src="/pax/resource/img/arrow_right.gif">',
width: '18px'
} );
pax.widget.button.init( pax.$('widget.button.init.example1.but4'), {
func: function(e) { alert( 'you clicked button 4.' ); },
content: '<img src="/pax/resource/img/arrow_right_full.gif">',
width: '18px'
} );
:]This example shows some built-in image buttons
TODO: Make it autodetect ‘button’ and ‘input type=”button”’, and render accordingly.
Renders a button into the given target
pax.widget.button.init = function( target, args )