Closed Eseperio closed 4 years ago
https://github.com/2amigos/yii2-chartjs-widget/blob/0b310668186711e73fcc73fba7eb07f0c174224e/src/ChartJs.php#L101
When registering clientScript the default context is View::POS_READY, that wraps all the javascript in a jquery function and makes it inaccesible.
View::POS_READY
If you are rendering many views in a component with renderPartial you will not be able to access javascript chart object in the browser..
Changing it to View::POS_END can solve this problem. Or maybe adding a parameter to change script position on demand.
@Eseperio have time for a PR?
Currently i don´t have so much free time, but i´ll try to make it.
@Eseperio I am on the same situation... :(
https://github.com/2amigos/yii2-chartjs-widget/blob/0b310668186711e73fcc73fba7eb07f0c174224e/src/ChartJs.php#L101
When registering clientScript the default context is
View::POS_READY
, that wraps all the javascript in a jquery function and makes it inaccesible.If you are rendering many views in a component with renderPartial you will not be able to access javascript chart object in the browser..
Changing it to View::POS_END can solve this problem. Or maybe adding a parameter to change script position on demand.