Fabrik and Plotalot with variables in Calc

sunnyjey

Active Member
I am trying to insert Plotalot variable in Calc, but somehow it is not working.

As per this thread:
http://fabrikar.com/forums/index.ph...talot-with-variables.44027/page-2#post-226001
@cheesegrits has suggested to use
Code:
FabrikHelperHTML::runContentPlugins($myString);

to run Plotalot code, eg

Code:
$year ='{listname___myelement_year}';
$myString = '{plotalot id="21" P1="' . $year . '"}';
FabrikHelperHTML::runContentPlugins($myString);
return $myString;

In another thread @cheesegrits has suggested to pass evalScripts() function to be run if the plotalot graph to be changed on the fly. Ref Thread: http://fabrikar.com/forums/index.php?threads/run-js-in-php-on-calc-plugin.45320/#post-233465

Code:
$response = "all the other visible stuff for the plotalot graph";
$response .= '<script type="text/javascript">evalScripts();</script>';
return $response;

Please help me to understand how to pass evalScripts() function in Calc with Plotalot variable. I have tried following, but didnt work.

Code:
$year ='{listname___myelement_year}';
$myString = '{plotalot id="21" P1="' . $year . '"}';
FabrikHelperHTML::runContentPlugins($myString);
$response = $myString ;
$response .= '<script type="text/javascript">evalScripts();</script>';
return $response;
 
Last edited:
Does
Code:
return '{plotalot id="21" P1="2020"}';
or
Code:
return JHTML::_('content.prepare', '{plotalot id="21" P1="2020"}');
work?

If so, then
Code:
$year ='{listname___myelement_year}';
return '{plotalot id="21" P1="' . $year . '"}';
or
Code:
$year ='{listname___myelement_year}';
return JHTML::_('content.prepare', '{plotalot id="21" P1="' . $year . '"}');
should work, too.
If not, what element type is listname___myelement_year? Perhaps you need to append _raw?
 
Thank you for reply. Please find my answers in bold letters.

Does this work ?
Code:
return '{plotalot id="21" P1="2020"}';
NO

Code:
return JHTML::_('content.prepare', '{plotalot id="21" P1="2020"}');
This works

Code:
$year ='{listname___myelement_year}';
return '{plotalot id="21" P1="' . $year . '"}';
Doesn't work

Code:
$year ='{listname___myelement_year}';
return JHTML::_('content.prepare', '{plotalot id="21" P1="' . $year . '"}');
Doesn't work

If not, what element type is listname___myelement_year? Perhaps you need to append _raw?

Tried with both normal field (2020) as well as dropdown field (2020) with both _raw and without raw values.

As per Hugh ( Ref: Thread), we need to pass plotalot evalScripts() function to the Calc:

I added it specifically for someone who was using the calc element to produce 'plotalot' graphs, which she wanted to update on the fly when altering dropdown selections. The problem was that although we could generate the plotalot plugin code from the calc, it also required the plotalot evalScripts() function to be run if the graph was changed on the fly.

I dont know how to pass evalscripts() to calc.
 
Yes.

I spent hours with different code combination, deleting cache, loading form through plugin / direct form load ... But still not able to figure it out.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top