i want to add custom button on view page in the line of toolbar.
i tried but button is coming below the toolbar.
i was used page_datarendering() for this problem but it dint work properly.
anybody can help...........??
add custom button in toolbar on view page
-
- User
- Posts: 17
add custom button in toolbar on view page
-
- User
- Posts: 11723
Simply put the following code in "Page_Render" server event that belongs to the "View Page":
$options = &$this->OtherOptions; // use OtherOptions
$option = $options["action"]; // part of action button
$item = &$option->Add("my_new_button"); // <--- adjust it to yours
$item->Body = '<a class="btn btn-default ewAction ewEdit" title="My Home" data-caption="My Home" href="home.php"><span data-phrase="My Home" class="glyphicon glyphicon-home ewIcon" data-caption="My Home"></span></a>'; // <-- adjust it to yours
-
- User
- Posts: 11723
Simply put the following code in "Page_Render" that belongs to the "List Page":
$item = &$this->SearchOptions->Add("my_new_button");
$item->Body = '<a class="btn btn-default ewAction ewEdit" title="My Home" data-caption="My Home" href="home.php"><span data-phrase="My Home" class="glyphicon glyphicon-home ewIcon" data-caption="My Home"></span></a>'; // <-- adjust it to yours
-
- User
- Posts: 980
Yes you can.
The logic goes this way:
- Check whether the page is in master/detail mode.
- Do your code based on that condition.
There are plenty ways to check the condition. Search this forum for "getCurrentMasterTable". You can also use isset($_GET[EW_TABLE_SHOW_MASTER]). Or any other ways that fit your code well.