I just want to print a value from Craft into a JavaScript function to filter a dashboard.
The function is this:
showOnly(filterName, values);
I tried this:
showOnly('Short Names','{{ entry.title }}');
But that did not work. And yes, the filter does work If I hard wire the value that Craft/Twig should print. But, I need it to match the title of the page as one navigates from entry to entry.
UPDATE
Here is the actual showOnly
function in its entirety:
function showOnly(filterName, values) {
// Think a single select filter.
sheet = mainViz.getWorkbook().getActiveSheet();
if(sheet.getSheetType() === 'worksheet') {
sheet.applyFilterAsync(filterName, values, 'REPLACE');
} else {
// for dashboards
worksheetArray = sheet.getWorksheets();
for(var i = 0; i < worksheetArray.length; i++) {
worksheetArray[i].applyFilterAsync(filterName, values, 'REPLACE');
}
}
};