Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Add Action Buttons on Browse Screen

Locked
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Add Action Buttons on Browse Screen

Unread post by massiws »

After searching and filtering records on Browse screen, I want to be able to run an activity with an extra button, the same workflow as Print button, but with my logic.
I tried to solve with jQuery in nuLoadThis() function:

Code: Select all

function nuLoadThis() {
    $(".actionButton").filter(":last").append("<input>");
}
but don't work: new button dont appear.
Tried also to use addJSfunction() in Before Browse with the same result.

Is there a way to add an extra button to Browse Screen to run an activity?

Max
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Add Action Buttons on Browse Screen

Unread post by massiws »

I found a solution to make Extra Action buttons appear on browse form!

I added this code in Custom Code > Before Browse:

Code: Select all

$js = <<<EOJS
function nuLoadThis() {
  /* Append a new Action Button on Browse form */
  var elem = '<input id="execButton" type="button">';
  $( "#actionButtons" ).append( elem );
  $( "#execButton" )
    .addClass( "actionButton" )
    .attr( "value", "Execute" )
    .click(function() {
      // Do something
      alert( "Clicked!" );
    });
}
EOJS;
addJSfunction($js); 
Extra Action Button on Browse form
Extra Action Button on Browse form
BrowseActionButton.png (104.8 KiB) Viewed 6605 times
Max
Locked