How to Add a Custom Action like Search in the Header

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
zimmerlis
User
Posts: 9

How to Add a Custom Action like Search in the Header

Post by zimmerlis »

Hi all

I need to have a custom action arround the section where the search box is.
I did not found any custom code section to add another overall page action like the search.

Also I did not have found where I can colapse the searche section, is there a posibility?

Details what I whant to realize:

  1. I need to have a Button "Sync Data"
  2. I have already the PHP code that should run , when I klick to the Sync Data button
  3. The Custom code is like a refresh action, that sync the data source with the current table.
  4. It would be fine to have a spinner or a ajax box with a status log, during my custom code is running.

Probably it would help me, if i could get help to realize a refresh button in the search area at all.

regards, René


danielc
User
Posts: 1601

Post by danielc »

To collapse search section, enable [Tools]->[Advanced Settings]->[Initiate search panel as collapsed]. See Tools (Advanced Setting portion) in help file.

If you want to create your custom button to search section, see this topic to use client script to add your button, http://www.hkvforums.com/viewtopic.php?f=18&t=34235.


zimmerlis
User
Posts: 9

Post by zimmerlis »

Thanks, this solved my problems!


zimmerlis
User
Posts: 9

Post by zimmerlis »

The Problem was, there are many tables in the listpage , so with the code above there are multiple buttons.

Now I do the .append to a DIV Class .ewListOtherOptions', so my button gets added to the last action button like Add on top of the table.

$(document).ready(function() {
$('.ewListOtherOptions').append('<div class="btn-group ewButtonGroup"><button class="btn ewAddEdit ewAdd btn-small" name="btnSync" id="btnSync" type="Button"><?php echo $Language->Phrase("reloadbtn") ?></button></div>');
$('#btnSync').attr('onClick', "window.open('mypage.php')");
});

This is now working, now I would like to open the mypage.php in a small box with a close button.
So window.open will open a new Tab in my browser, but I want to open just a dialog box like: jqueryui.com/dialog/

What jquery libraries are loaded in PHPMaker? jQuery UI or something similar?

Any hint?


danielc
User
Posts: 1601

Post by danielc »

View page source and look at header portion, you will find the list of js/stylesheet. If you want to add your js, see Server event and Client script (Page_Head portion) in help file.


wwarnapura
User
Posts: 2

Post by wwarnapura »

This code is very helpful and working fine. Thank you


Post Reply