This topic is locked

How to change button label dynamically

12/17/2014 1:57:09 PM
PHPRunner Tips and Tricks
admin

We have added a button to the Orders table grid and want to change button label dynamically based on order status.

  1. Insert button into grid and switch to HTML mode. Here is how button's HTML code look by default

<A class="rnr-button button" id="New_Button3" href="#" typeid="ib">

New_Button3

</A>


2. Modify it the following way

<A class="rnr-button button" id="New_Button3" href="#" typeid="ib">

{$button_label}

</A>


3. Now add the following code to List page: AfterRecordProcessed event:

if ($data["ShipCountry"]=="Germany")

$record["button_label"] = "Senden bestellen";

else

$record["button_label"] = "Archive order";


And this is how it looks in generated application: