Hey together,
I’m working with the jqplot extension. I’ve got some issues on setting the right plot-id, plot-name or whatever you call it in the onclick-Event at my buttons.
<button type="button" value="reset" onclick="plot1.resetZoom();" name="resetPlotZoom">Reset Zoom</button>
I’ve got some buttons, which are meant to call simple jqPlot functions. Unfortunately I don’t get the right name of my jqPlot Plot/Graph to call the functions and so the buttons won’t work.
Here’s an example code from the jqplot documentation, which I’m trying to fit in yii code form.
$("input[type=checkbox][name=gridsHorizontal]").change(function(){
plot1.axes.yaxis.tickOptions.showGridline = this.checked;
plot1.replot();
});
or another example, my zooming:
<button onclick="plot1.resetZoom();" type="button" value="reset"></button>
The class JqplotGraphWidget catches the class id and set it as chartdiv
public function run(){
$id=$this->getId();
$this->htmlOptions['id']=$id;
echo CHtml::openTag($this->tagName,$this->htmlOptions);
echo CHtml::closeTag($this->tagName);
$plotdata=CJavaScript::encode($this->data);
$flotoptions=CJavaScript::encode($this->options);
Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"$.jqplot('$id', $plotdata, $flotoptions);");
}
I also trying setting the id in the view
... onclick="yw1.resetZoom();" ...
How could I get the right id in my view? Or am I on a completly wrong way?