This topic is locked
[SOLVED]

 Some Extra Buttons On Add Page

7/4/2013 3:20:27 AM
PHPRunner General questions
S
swanside author

Hello.

Is it possible to have a couple of extra buttons on the add page?
1; Save and Export

2; Save and Back To List
Cheers

Paul.

Sergey Kornilov admin 7/11/2013

Here is how you can implement 'Save and back to List' button.
We will use the idea described in this article for inspiration: http://xlinesoft.com/phprunner/docs/add_custom_field_to_form.htm

  1. Add a new button to the form via 'Insert button' in Visual Editor
  2. ClientBefore event:

pageObj.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

formObj.baseParams['golist'] = "1";

});
$("#saveButton1").click();
return false;


3. AfterAdd event:

if($_REQUEST["golist"])

{

header("Location: ..._list.php");

exit();

}


In regards to Save and Export - not really sure how this can be implemented.

S
swanside author 7/11/2013



Here is how you can implement 'Save and back to List' button.
We will use the idea described in this article for inspiration: http://xlinesoft.com/phprunner/docs/add_custom_field_to_form.htm

  1. Add a new button to the form via 'Insert button' in Visual Editor
  2. ClientBefore event:

pageObj.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

formObj.baseParams['golist'] = "1";

});
$("#saveButton1").click();
return false;


3. AfterAdd event:

if($_REQUEST["golist"])

{

header("Location: ..._list.php");

exit();

}


In regards to Save and Export - not really sure how this can be implemented.


Cheers. Will give that a try out.
Thanks

Paul.