سؤال

Im using nestedSortable and for some time it works fine but after about 1min of use it breakes down and does not return entire list but only part of it. Im using toArray to return data back to php script which then fills in mysql but if returned json value is not for entire list update messes up the database.

Is anyone having trouble with this strange behavior or am I doing something wrong ?

            $('#load').click(function(){
            $.get("get_tags.php", function(data){
                $("#data").html(data);
                $('ol.sortable').nestedSortable({
                    disableNesting: 'no-nest',
                    forcePlaceholderSize: true,
                    handle: 'div',
                    helper: 'clone',
                    items: 'li',
                    maxLevels: 3,
                    opacity: .6,
                    placeholder: 'placeholder',
                    errorClass: 'error',
                    revert: 250,
                    tabSize: 25,
                    tolerance: 'pointer',
                    toleranceElement: '> div',
                    update: function () {
                        list = $(this).nestedSortable('toArray');
                        $("#result2").html(JSON.stringify(list));
                        $.post('x.php', { update_sql: 'ok', list: JSON.stringify( list ) },
                            function(data){
                                $("#result").html(data);
                            }, 
                                "html" )
                    }
                }); 
            }); 
        });

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top