2014-10-01 80 views
0

我使用下面的链接进行排序CGridview一行之后,无法拖动的Yii CGridview行更新

http://www.yiiframework.com/wiki/238/creating-a-jqueryui-sortable-cgridview/

其工作正常,但网更新后我能不能拖动网格行!

我的代码,

$('#basefilter-grid table').sortable({ 
      forcePlaceholderSize: true, 
      forceHelperSize: true, 
      items: 'tr', 
      update : function() { 
       serial = $('#basefilter-grid table').sortable('serialize', {key: 'order[]', attribute: 'class'}); 
       $.ajax({ 
        'url': '" . $this->createUrl('baseContact/orderFilterRow') . "', 
        'type': 'post', 
        'data': serial, 
        'success': function(data){ 

          $.fn.yiiGridView.update('basefilter-grid'); 

        }, 
        'error': function(request, status, error){ 
         alert('We are unable to set the sort order at this time. Please try again in a few minutes.'); 
        } 
       }); 
      }, 
      helper: fixHelper 
     }).disableSelection(); 

我列“订单”后一行拖动其得到更新,电网只刷新更新值将被视为后,所以我需要迫切更新电网,任何人都可以说如何做这个?

+0

有没有在您的浏览器控制台日志中的任何错误? – chaos505 2014-10-01 12:12:07

+0

没有错误只是我不能拖动网格更新后的网格行! ! – 2014-10-03 05:16:18

回答

0

我想我知道问题是什么。如果您的网格所在的视图中添加了任何javascript或CSS,则在ajaxUpdate之后可能无法使用它们。我建议你重新激活用于拖放的插件或额外的JS功能。

例如,如果你想使用引导提示你需要的ajaxUpdate后重新激活它们:

'afterAjaxUpdate' => 'function(id,data) { $("[rel=\"tooltip\"]").tooltip(); }',