where should I initialize or where to include this fancybox js scripts and css, if the CGridView is rewritten by extending the original CGridView class ?
what you are actually doing here is triggering the initialization of all the matched elements by the class selector ‘.fancybox’, on the ‘click’ event. Although you are doing the initialization, you are not leting fancybox manage the <a> elements’ onclick event in the proper way.
and, as Roman said, put the fancybox initialization in the document.ready event. But if you insist to initialize the fancybox object in the grid, you should write
But you may need to wait in between these two calls, would have to test it…
By the way, you are repeating the same link over and over again for every cell in the grid column. Does it make any sense? I would put the link outside the grid.
it should repeat, coz every row contains a different ID, what am planning to do is, get the id of each row, and then get the images that are owned by that data id…that’s how i’m thinking …but it’s still blurry at the moment…i need to make this fancybox work first, as I embedded an image in the view file to test if it will show up…before i dive in pulling the image names from the db