如何使gridstack自动小部件停止向上移动?

Uma*_*zai 5 javascript jquery gridster

我希望Gridstack团队能够保持健康。我只希望能够在移动小部件时使其他小部件不会向上填充它的空白处。相反,更像是我希望其他小部件在移动一个小部件时不要停留在其位置,并且不要向上填充新移动的小部件位置。我该怎么办?谁能让我知道..?我试图在所有地方进行检查和搜索,但是要么没有得到它,要么没有得到它如何使它工作..!

 <script type="text/javascript">
 var jq=jQuery.noConflict();
    jq(document).ready(function (e) {
    jq('.upload').on('submit',(function(e) {
        e.preventDefault();
        var formData = new FormData(this);

        jq.ajax({
            type:'POST',
            url: jq(this).attr('action'),
            data:formData,
            cache:false,
            contentType: false,
            processData: false,
            success: function(data)
        {
          jq(".no_image").css("display", "none"),
          jq(".show_image").css("display", "block"),
          jq(".profile_photo").val(function(index, currentValue) {
    return currentValue + data;
});
      jq(".image").attr("src","client_images/"+data);
        },
            error: function(data){
                console.log("error");
                console.log(data);
            }
        });
    }));

    jq(".inputFile").on("change", function() {
        jq(".upload").submit();
    });
$(function () {
    var options = {
        cell_height: 70
    };
    $('.grid-stack').gridstack(options);
     this.grid = $('.grid-stack').data('gridstack');
      this.save_grid = function () {
                    this.serialized_data = _.map($('.grid-stack > .grid-stack-item:visible'), function (el) {
                        el = $(el);
                        var node = el.data('_gridstack_node');
                        return {
                            x: node.x,
                            y: node.y,
                            width: node.width,
                            height: node.height
                        };
                    }, this);
                     $.ajax
    ({
        type: "POST",
        //the url where you want to sent the userName and password to
        url: 'save_grid.php',
        async: false,
        //json object to sent to the authentication url

        data: {'positions': JSON.stringify(this.serialized_data, null, '    ')},
        success: function () {

        alert("Positions Saved!"); 
        }
    })

                }.bind(this);


                $('#save-grid').click(this.save_grid);

                this.load_grid();
});



});
</script>
Run Code Online (Sandbox Code Playgroud)

实时示例: http : //troolee.github.io/gridstack.js/

Uma*_*zai 5

尝试float: true在初始化选项中进行设置。除非您手动移动网格项,否则它们不会向上或向任何地方移动。

例如 :

$(function () {
    var options = {
        cell_height: 80,
        float : true
    };
    $('.grid-stack').gridstack(options);
});
Run Code Online (Sandbox Code Playgroud)