2014-10-01 52 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(); }',