gridstack实现布局可编辑修改删除添加效果代码

代码语言:html

所属分类:其他

代码描述:gridstack实现布局可编辑修改删除添加效果代码

代码标签: gridstack 布局 编辑 修改 删除 添加 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!doctype html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.4.3.1.min.css">

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/gridstack.css">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
	<style type="text/css">
        .grid-stack {
            background: lightgoldenrodyellow;
        }

        .grid-stack-item-content {
            color: #2c3e50;
            text-align: center;
            background-color: #18bc9c;
        }
    </style>
	<!--[if IE]>
		<script src="../FrontEnd/js/html5.min.js"></script>
	<![endif]-->
</head>
<body>
	<div class="jq22-container">
		<div class="jq22-content bgcolor-3">
			<div class="container-fluid">
		        <h1>添加或删除GridStack.js组件Demo</h1>
                <div>
                    <button data-bind="click: add_new_widget">添加</button>
                </div>

                <br>

                <div data-bind="component: {name: 'dashboard-grid', params: $data}"></div>
		    </div>
	    </div>
		
	</div>
	
	<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.1.11.min.js"></script>
	<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-ui.1.12.1.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/lodash.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/knockout.3.4.0.js"></script>
	<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/bootstrap.4.3.1.min.js"></script>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gridstack.js"></script>

    <script type="text/javascript">
        ko.components.register('dashboard-grid', {
            viewModel: {
                createViewModel: function (controller, componentInfo) {
                    var ViewModel = function (controller, componentInfo) {
                        var grid = null;

                        this.widgets = co.........完整代码请登录后点击上方下载按钮下载查看

网友评论0