I have a table that similar like the one in the attached file. I want to add some javascript for mouseover which means when I move to mouse pointer to an item inside div tag area, it would show a small window within detail of this item, similar like what you see in every shopping sites. So how could I do it in Yii when there are many built-in functions inside?
And also, I used findAll() to get all items detail in the controller and send it to the view. But in the view, I dont know how to use them with javascript.
As far as I know, you can’t do it directly in Yii, so you have to write some jQuery for it, or use a jQuery plugin, or find a Yii extension that wraps one…
I have $model->findAll() in controller, and send it to a view. In this view I use foreach with $model to create many buttons with id = $model->id, onclick = aFunction($model->id). If i click on the button number 3 -> run the aFunction(3).
In javascript I want somehow get the $model[3] (in php) to analyze in the aFunction() (in javascript).
Can I use $model in JQuery?
How i could use these variables with JQuery or pass them to a Jquery function?
Thank you , I will test and try to change it from ‘click’ to ‘mouseover’ because I want to run a script to display item’s detail when the mouse pointer move to this div tag.