Refresh Isotope-Jquery When Dataprovider Changes

Hi everybody,

Basicly I’m facing the same problem that kandalf explained here:

I’ve been trying to get a way to solve it.

By now, I have created a function I call when refreshing

My button:




$this->widget('bootstrap.widgets.TbButton', array(

     'buttonType'=>'button',

     'type'=>null,

     'icon'=>'refresh',

     'size'=>'mini',

     'label'=>'Actualizar',

     'htmlOptions'=>array(

          'onclick'=>'javascript:reloadIsotope();'

     )

));



The function:




function reloadIsotope() {

        var $isoContainer = $('#listaItems .items');

        $isoContainer.isotope('reloadIsotope');

}



And the code I inserted into jquery.isotope.js:




...

reloadIsotope: function() {

        this.$allAtoms.empty();

        this.$filteredAtoms.empty();

        this.element.children().empty();

        this.reLayout();                        

},

...



It seems to do the trick, isotope is being reloaded, but the ajax call is not being redone.

Does anyone know how to do this?

Maybe there is a way to directly update the yiiListView that’s behind the isotope control.

Thanks in advance!