mauroventura
Posts: 1
|
Posted: 01/19/2014, 9:28 AM |
|
Hello guys.
I need help.
I need (after a 'if' choice) to apply or not a onclick event call to an element (image) in a grid.
The best for me is to use the Beforeshowrow event and add some php code like this :
... if ( grid->image->getvalue()=="change") then add to image "onclick='myfunction();'"
else do nothing;
some suggestions??
thanks in advance
Mauro
|
|
|
jekes
Posts: 36
|
Posted: 01/20/2014, 5:41 AM |
|
Hi,
Maybe you can apply a client custom code on the onclick event of the element and then start your condition in the javascript code.
Assign feature >> Client custom code >> start event on the click of your element.
In the javascript custom code retrieve the the value of the element
$(this).attr("href") or $(this).attr("id") or $(this).attr("yourowntag");
test the value and start your function.
|
|
|
Lucius
Posts: 220
|
Posted: 01/20/2014, 12:34 PM |
|
Or if you want to be really smart, you can on server-side add some class to your image like:
<img ... class="clickable"> or <img ... class="notclickable"> then in JS program function that clicks basing of the link class.
I would use jQuery to help me in this task.
|
|
|
|