1

順序を取得する方法は理解していますが、必要なときにアクションの前に要素を前の位置に戻す方法がわかりません。

アドバイスをください、どうもありがとうございました。

el.sortable({
    start: function(){   var order = etc //Got current order here//  },

    update: function(){
         //Process and etc//

         if(cancel) {
            //how can I put the element back to the position before??
         }

    },


});
4

1 に答える 1

1

$( ".selector" ).sortable( "cancel") は機能します(もちろん、初期化の内側ではなく、ソート可能を初期化した後)

el.sortable({
    start: function(){   var order = etc //Got current order here//  },

    update: function(){
         //Process and etc//

         if(cancel) { //NO NOT HERE
            //how can I put the element back to the position before??
         }

    },


});

el.sortable("cancel"); //here

http://api.jqueryui.com/sortable/#method-cancelを参照してください

キャンセル()

現在のソート可能オブジェクトの変更をキャンセルし、現在のソートが開始される前の状態に戻します。stop および receive コールバック関数で役立ちます。このメソッドは引数を受け入れません。

于 2013-01-09T02:37:17.140 に答える