Yii Framework Forum: Refresh Isotope-Jquery When Dataprovider Changes - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Refresh Isotope-Jquery When Dataprovider Changes Rate Topic: -----

#1 User is offline   michelinho80 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 07-November 12
  • Location:Tenerife, Islas Canarias, EspaƱa

Posted 02 May 2013 - 07:37 AM

Hi everybody,

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

Quote

I'm using the isotope jquery extension, my dataProvider is changing over the time so I want to update it without refresh the entire page.

Someone know how can I do it?

I now the isotope is based on a CListView so I try to use this function $.fn.yiiListView.update(), but the yiiListView is not defined.

Any ideas that can help me?


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!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users