如何使用bootstrap和MVC在datatable中添加编辑功能

时间:2016-10-31 13:35:23

标签: javascript jquery asp.net-mvc twitter-bootstrap

我已经完成了以下代码,现在我想在Bootstrap Datatable中添加带有服务器端功能的编辑列,并在MVC和Bootstrap中使用。最后我想要正确的CRUD操作,那么我该如何处理呢?

<script type="text/javascript">
        var assetListVM;
        $(function () {
            assetListVM = {
                dt: null,

                init: function () {
                    dt = $('#assets-data-table').DataTable({
                        "serverSide": true,
                        "processing": true,
                        "ajax": {
                            "url": "@Url.Action("Get","Asset")"
                        },
                        "columns": [
                            { "title": "ID", "data": "ID", "searchable": true },
                            { "title": "Name", "data": "Name", "searchable": true },
                            { "title": "City", "data": "City", "searchable": true },
                            { "title": "EmpCode", "data": "EmpCode", "searchable": true },
                            { "title": "DOJ", "data": "DOJ", "searchable": true },
                            { "title": "Address", "data": "Address" },
                            { "title": "DOB", "data": "DOB" }
                        ],
                        "lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],

                    });
                }
            }

            // initialize the datatables
            assetListVM.init();                
        });

</script>

0 个答案:

没有答案