To add option to KoolToggleButton you do:
$splitbutton->AddOption(array( "Text"=>"Accept",
"Value"=>"Accept",
"LeftImage"=>"/path/to/leftimage.png")
"RightImage"=>"/path/to/rightimage.png")
"LeftImageCss"=>"leftimage_css")
"RightImageCss"=>"rightimage_css")
"ButtonCss"=>"button_css")
"ToolTip"=>"This is the button")
);
When button is clicked, you can capture the click event with:
$splitbutton->OnClick="do_something";
span style="color: #808080; font-style: italic;">/*
* This file is ready to run as standalone example. However, please do:
* 1. Add tags <html><head><body> to make a complete page
* 2. Change relative path in $KoolControlFolder variable to correctly point to KoolControls folder
*/
$KoolControlsFolder = "../../../../KoolControls";//Relative path to "KoolPHPSuite/KoolControls" folder
"/KoolForm/koolform.php""myform""/KoolForm""sunset""action");
/*Below are the full API of AddOption method.
*
$action->AddOption(array( "Text"=>"View order",
"Value"=>"View",
"LeftImage"=>"/path/to/leftimage.png")
"RightImage"=>"/path/to/rightimage.png")
"LeftImageCss"=>"leftimage_css")
"RightImageCss"=>"rightimage_css")
"ButtonCss"=>"button_css")
"ToolTip"=>"This is the button")
);
*/"Text"=>"Accept",
"Value"=>"accept_order",
"LeftImage"=> $KoolControlsFolder."/KoolForm/icons/plain/check2.png",
"ToolTip"=>"Accept the order""Text"=>"View order",
"Value"=>"view_order",
"LeftImage"=> $KoolControlsFolder."/KoolForm/icons/plain/text.png",
"ToolTip"=>"View details of the order""Text"=>"Cancel",
"Value"=>"cancel_order",
"LeftImage"=> $KoolControlsFolder."/KoolForm/icons/plain/delete2.png",
"ToolTip"=>"Cancel the order"));
$action->OnClick = "action_click"//Init form
"myform" method="post""decoration">
<fieldset style="width:350px;padding-bottom:10px;padding-left:10px;""width:70px;"><b>Name:</b></td>
<td>John Smith</td>
</tr>
<tr>
<td><b>Address:</b></td>
<td>103 Old MorganTown Road, Bowling Green</td>
</tr>
<tr>
<td><b>Product:</b></td>
<td>Apple iPhone 4s</td>
</tr>
</table>
<div style="margin-top:10px;""text/javascript""view_order":
alert("You choose to view order detail.""cancel_order":
alert("The order will be cancelled!""accept_order":
alert("The order will be accepted!"