Dynamically set print Message based on dropdown
Dynamically set print Message based on dropdown
yinsw
Posts: 3Questions: 1Answers: 0
I have a search panel with Dropdown selection and a Search button.
How do I dynamically set the button "Message" when I click the Print button? I've search all over the place but I can't find the solution. I just want to add some Report title based on what I filtered.
Kindly assist or let me know the information where I should refer to. Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can't dynamically set the print message since there is no API to set it, but you can dynamically generate it by providing the message option as a function - e.g.:
Its a regular Javascript function so you get information from the DOM, calculate values, whatever you need. Whatever you return from the function is what will be used.
Allan
The datatables already initialized upon accessing this page with the default search value. My search button will perform the following code when I click on it. I don't think I can set the message again when I click the Print button. What I want to do is the pass the variable $activity (my dropdown search filter value) to the Message variable.
As I say, you can "set" the message, but you can dynamically create it.
Just have the anonymous function for the
message
read the value from$('#inputActivity').val()
.Allan
Ahh.. Now I get it.. Thank you sooooo much! Much appreaciated.