[jifty-devel] Chart plugin: Handling scripts in regions

Thomas Sibley trs at bestpractical.com
Sun Aug 5 16:04:51 EDT 2007


Thomas Sibley wrote:
> Andrew Sterling Hanenkamp wrote:
>> A new problem I see now is that if you place a PlotKit chart inside of 
>> a region and then replace that with another region containing PlotKit 
>> charts, the charts never render because the script tags are stripped. 
>> I was trying to think of a better way to handle this and was wondering 
>> if we might render a table containing the data for the chart, which 
>> would then be replaced by a PlotKit chart when the next 
>> Behaviour.apply() call is made. This could be a standard facility 
>> provided by the plugin rather than by the renderer since I expect 
>> other renderers to need something like it. If PlotKit failed to 
>> render, at least there'd be a table showing the data.
> 
> I thought we eval'ed any scripts in the new region after it's been 
> inserted (and had some settle time).  It seems that we do (jifty.js, 
> line 966).  I imagine it's not working because the chart rendering is 
> being triggered as an onLoad event for the window.  It should probably 
> change to an onAvailable event for the div being inserted.

Oh, and that said though, I think even if we don't technically need it, 
having a table-based renderer would be a good idea, perhaps with the 
ability to specify as a fallback renderer.


More information about the jifty-devel mailing list