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...........??
How to add custom button in toolbar on View page? (v2017)
-
- User
- Posts: 17
How to add custom button in toolbar on View page? (v2017)
-
- User
- Posts: 11769
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: 11769
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.
-
- User
- Posts: 11769
If you meant "toolbar" is the line section where the Export buttons are located, then you should add it on each page separately.
However, if you meant "toolbar" is the navbar section, then you may use Page_Foot server event to add that custom button by customizing the navbar section.
-
- User
- Posts: 97
mobhar wrote:
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
Hi
i have try to use the above code in page_Render list page (version 2020)
but the button not apear with me
what is the resone