CodeChargeMVP
Posts: 473
|
| Posted: 05/16/2011, 4:39 AM |
|
Hi,
I�m trying to modify the value of a button which inside a grid,
I though than the button would behave as other components inside a grid,
like I did before by modify string descriptions etc.. but what�s my surprise
than If I try $NameOfTheGrid->$NameOfTheButton->Value or SetValue()
it just doesn�t work, the property Value or SetValue isn�t showed, in OOP meanings
is like the method Value or SetValue doesn�t own to the button,
so the question is:
�How could I modify the value of the button inside the grid?
Thank you very much in advance.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
damian
Posts: 838
|
| Posted: 05/16/2011, 4:55 AM |
|
what are you trying to change? a button is not the same as the other objects you mention because it is not dynamic, it is not pulled from the database.
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 05/16/2011, 5:57 AM |
|
Ok I understand,
The Right way to proceed on this task would be modifying the value of the button from php before show event, but since this is not possible, I´ll try to invent some trick from Javascript by make this work.
I´m changing the link from the search grid by a buttom, with the same behave than the link, showing the value and on click leading on the parent window.
Quote damian:
what are you trying to change? a button is not the same as the other objects you mention because it is not dynamic, it is not pulled from the database.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
datadoit
|
| Posted: 05/16/2011, 6:12 AM |
|
Use the template variable.
1. In the HTML for the button, set the button value to something like:
value="{YourButton}"
2. In the BeforeShow server-side event for the button:
global $Tpl;
if (This or That) {
$Tpl->SetVar("YourButton", "Click Me!");
}
else {
$Tpl->SetVar("YourButton", "Don't Click Me!");
}
|
|
|
 |
CodeChargeMVP
Posts: 473
|
| Posted: 05/16/2011, 7:10 AM |
|
This code has quite sense, but it doesn´t work for me,
the function setvar appear lowercased and expect two params,
the key and the value, I did that way but the button show no result,
doesn´t appear anything on the value button.
I did a solution with javascript but I had to use try and catch by avoid two pop-up window
errors,so if I could solved it from the php server side event so much better.
Quote datadoit:
Use the template variable.
1. In the HTML for the button, set the button value to something like:
value="{YourButton}"
2. In the BeforeShow server-side event for the button:
global $Tpl;
if (This or That) {
$Tpl->SetVar("YourButton", "Click Me!");
}
else {
$Tpl->SetVar("YourButton", "Don't Click Me!");
}
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
|