在角度数据表的顶部而不是底部进行单独的列搜索 [英] Individual column search on top rather than bottom in angular datatable
问题描述
我正在使用该库 https://l-lin.github. io/angular-datatables/#/welcome 对于我的angular 7项目,我已经按照示例给出的方式实现了代码,
I am using this library https://l-lin.github.io/angular-datatables/#/welcome for my angular 7 project I have implemented the code as given the the example as it is, https://l-lin.github.io/angular-datatables/#/advanced/individual-column-filtering.
它工作得很好,但是唯一的问题是搜索列的位置,
我想要标题名称后面的标题中的搜索列,
我尝试将tfoot
转换为thead
,但无法正常工作.
It is working perfectly fine , but only problem is the position of the search columns ,
I want the search columns in header after the columns names,
I tried converting the tfoot
to thead
but it's not working.
我发现了一些示例,例如 http://live.datatables.net/cutucahi/1/编辑,但示例将标题列替换为我不想要的搜索框
I found some examples like http://live.datatables.net/cutucahi/1/edit, but the exmaple is replacing the header columns with the search box which i dont want
推荐答案
尝试以下示例
initComplete: function ()
{
var r = $('#MyDataTable tfoot tr');
r.find('th').each(function(){
$(this).css('padding', 8);
});
$('#MyDataTable thead').append(r);
$('#search_0').css('text-align', 'center');
},
如果不检查以下链接中的解决方案
If not check solution in following link
https://datatables.net/examples/api/multi_filter.html -在评论"部分.给出了多种解决方案.
https://datatables.net/examples/api/multi_filter.html -- In Comments section. Multiple solutions are given.
这篇关于在角度数据表的顶部而不是底部进行单独的列搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!