Need a special offer?Find out if your project fits.
+

How to handle an angularjs function with cell.text

Resolved
Tiago asked on August 4, 2021

Hello,
I'm trying to handle an angularjs function when the user click on the grid text.
For example:
$scope.myFunction = function () {
//Todo
};
 
//Inside Flexmonster customizeCell function
cell.text = '<a ng-click="myFunction()">Text</a>';
 
Is it possible?
 
Best regards,
Tiago
 
 
 

3 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster August 4, 2021

Hello, Tiago,
 
Thank you for posting on our forum.
 
Instead of embedding links directly in cells, we recommend using the cellclick event. It is triggered when a cell is clicked on the grid. You can invoke any handler after the dedicated cell is clicked. You can also configure what function is invoked and adjust it based on the information received from the handler.
 
Please let us know if it works for you.
 
Kind regards,
Illia

Public
Tiago August 4, 2021

Hi, Illia,
 
Thanks for the reply.
 
Unfortunately i cant use the cellclick event because of the business rules, instead i need to trigger an event when the text inside the cell is clicked.
 
Best regards,
Tiago

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster August 5, 2021

Hello,
 
Thank you for your feedback.
 
If using the cellclick event is not an option for you, embed a clickable element similar to your initial example. Please note that you will need to increase z-index of this element to make it reachable.
Here is JSFiddle for demonstration: https://jsfiddle.net/flexmonster/720mk5bz/.
 
Please let us know if it works for you.
 
Kind regards,
Illia

Please login or Register to Submit Answer