Welcome Guest, Not a member yet? Register   Sign In
jQuery onchange problems with 'Sortable'
#1

[eluser]Chris Newton[/eluser]
I'm using jQuery's 'sortable' function, and I can't get anything to happen with the onchange part of the function for the life of me. I've tried stripping out all of the ajax code just for sure, but the onchange function still doesn't seem to fire. I can provide more code, but I thought maybe there was some simple piece of jQuery code that I have screwed up somewhere. The 'sortable' function works-ish... that is, the fields that are supposed to be rearrangable can be rearranged, I just can't use that rearranged order for anything else.

Code:
$(document).ready(function(){
    $("#sortable_message_fields").sortable({
        containment: 'document',
            accept: "sort_item",
        onchange: function(sorted){
            serial=$('#sortable_message_fields').sortable('serialize');
            $.ajax({
                url:"<?=base_url().'ajax/reorder_text_inputs'?>",
                type:"POST",
                data:serial.hash,
                complete:function(feedback){$("#data_panel").html("complete");},
                success:function(feedback){$("#data_panel").html(feedback);},
                error:function(feedback){$("#data_panel").html("error");}
            });
        }
        });
        
});
Any help would be greatly appreciated.
#2

[eluser]GSV Sleeper Service[/eluser]
are you using the jqueryUI version? if so, it is expecting a method named 'change' not 'onchange'
#3

[eluser]Chris Newton[/eluser]
Brilliant!!!!1!!!

GSV FTW!


Seriously thanks. That fixed it (mostly)




Theme © iAndrew 2016 - Forum software by © MyBB