Question

I am working with Yii and I have added isotope to my CListView and CGridView pages so display them a little better.

This works fine, except when the pagination is used, and the content on the page is changed using ajax the isotope no longer works.

This in itself is an easy fix, I just need to re-initiate the isotope library, the problem is I need to add my function to the onsuccess function of the ajax call used by the pagination.

My question is, how can I add javascript to the pagination function so when the ajax call is a success I can re-initiate my isotope library. I can't seem to find any options or ideas of where to add this.

Note: I also tried using the DOMSubtreeModified method where I track if an element has changed and do it that way but it seems to crash my firefox when using the isotope code.

Thanks

Was it helpful?

Solution

CListView has afterAjaxUpdate that you can use, see here for more info,

also CGridView has the same, look here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top