Cgridview And Js

Hi, I have come to face the following recently which seems really peculiar.

I use the CGridView to render a grid. If requests are ajax, I do partial rendering of the Grid. All the js that is included with my render never gets run. If I do the same (partial view render) in a normal jQuery ajax call, my rendered scripts always get executed. But with CGridView this is not happening. Going one step further, I use afterAjaxUpdate. This triggers a function with two parameters, id and data. However, as it turns out if you apply some js on the data you will never see the modifications. Instead, applying some js on the id $(’#gridViewId’) things work just fine. My problem is solved using the id of the grid, but, I can’t help but wonder what is it that I can’t see and I get this behavior in either case

  1. Why the rendered js in not run (and it really is rendered)

  2. Why when the data in afterAjaxUpdate are modified you still don’t get to see the modifications (i.e. trigger some jQuery plugins on the filter inputs)