C# datatablejs mvc多表我从表1进行的搜索也会触发表2
我在同一页中使用了2个数据表。当我从searchbox搜索时,两个表受到影响。我怎样才能解决这个问题。当页面加载时,我很好地得到了我的两个数据表。获取时没有错误。但当我试图搜索其中一个表中的某些值时,两个表同时受到影响。 当我尝试在table1搜索框中搜索时的示例:比如:“XYZ”,它在table2搜索框中写道:“XYZ” 我如何解决这个问题 以下是我的用途:C# datatablejs mvc多表我从表1进行的搜索也会触发表2,c#,html,jquery,model-view-controller,datatables,C#,Html,Jquery,Model View Controller,Datatables,我在同一页中使用了2个数据表。当我从searchbox搜索时,两个表受到影响。我怎样才能解决这个问题。当页面加载时,我很好地得到了我的两个数据表。获取时没有错误。但当我试图搜索其中一个表中的某些值时,两个表同时受到影响。 当我尝试在table1搜索框中搜索时的示例:比如:“XYZ”,它在table2搜索框中写道:“XYZ” 我如何解决这个问题 以下是我的用途: <table id="exampleDatatable" class="table"&
<table id="exampleDatatable" class="table">
<thead>
<tr>
....
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
....
</tr>
}
</tbody>
</table>
最后这里是我的DataTableTRInitialize()
新编辑:2020年9月14日:
我在dataTables.bootstrap4.js中发现了这一点:
/* Default class modification */
$.extend( DataTable.ext.classes, {
sWrapper: "dataTables_wrapper dt-bootstrap4",
sFilterInput: "form-control form-control-sm",
sLengthSelect: "custom-select custom-select-sm form-control form-control-sm",
sProcessing: "dataTables_processing card",
sPageButton: "paginate_button page-item"
} );
table = $(table).DataTable({
"iDisplayLength": 10,
"order": [[0, "desc"]],
"columnDefs": defs,
"oLanguage": {
"sUrl": '/Content/js/demo/Turkish.json'
},
stateSave: true
});
/* Default class modification */
$.extend( DataTable.ext.classes, {
sWrapper: "dataTables_wrapper dt-bootstrap4",
sFilterInput: "form-control form-control-sm",
sLengthSelect: "custom-select custom-select-sm form-control form-control-sm",
sProcessing: "dataTables_processing card",
sPageButton: "paginate_button page-item"
} );