2014-10-01 2 views
0

내가 CGridview 행을 정렬 아래 링크를 사용하고 이후는이 제대로 작동 업데이트

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

을 YII 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

+0

오류가 없으면 그리드 업데이트 후 그리드 행을 끌 수 없습니다 !! ! –

답변

0

나는 문제가 무엇인지 압니다. 그리드가 사는 뷰에 자바 스크립트 또는 CSS가 추가 된 경우 ajaxUpdate 이후에 해당 자바 스크립트 나 CSS를 사용할 수 없습니다. drag'n'drop에 사용 된 플러그인이나 추가 JS 기능을 다시 활성화하는 것이 좋습니다. 당신은 부트 스트랩 툴팁을 사용하려는 경우 예를 들어

, 당신은 ajaxUpdate 후이를 다시 활성화해야합니다

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