gpt4 book ai didi

javascript - 为什么我的数据表数据设计在 JQuery Datatable 中无法正常工作?

转载 作者:行者123 更新时间:2023-12-01 05:11:35 24 4
gpt4 key购买 nike

我有以下代码,查看我的输出图像,我的设计散布各处,这背后的原因是什么。

<div class="row">
<div class="col-md-12">
<div class="panel panel-primary list-panel" id="list-panel">
<div class="panel-heading list-panel-heading">
<button type="button" class="btn btn-default btn-md" data-toggle="modal" data-url="@Url.Action("Create","Group")" id="btnCreateBranch">
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Add Group
</button>
</div>
<div class="panel-body">
<table id="group-data-table" class="table table-striped table-bordered" style="width:100%;">
</table>
</div>
</div>
</div>

我的 Jquery 脚本是:

                    "columns": [
{ "title": "Group Code", "data": "GroupCode", "searchable": true },
{ "title": "Group Description", "data": "GroupDesc", "searchable": true },

{
"title": "Action",
"data": "GroupCode",
"searchable": false,
"sortable": false,
"render": function (data) {
return '<a href="@Url.Action("Edit","Group")?GroupCode=' + data + '" class="btn btn-primary editGroup">Edit</a> <a href="@Url.Action("Delete","Group")?GroupCode=' + data + '" class="deleteGroup btn btn-danger">Delete</a>';
}
}
],
"lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],
});
},

refresh: function () {
dt.ajax.reload();
}
}

我的最终输出是: My output image

最佳答案

我已经通过在所有列中使用“sWidth”:“300px”来解决我自己设置宽度的问题并解决问题。

关于javascript - 为什么我的数据表数据设计在 JQuery Datatable 中无法正常工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61982322/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com