Hide/Remove 来自 jQuery ColumnFIlterWidget 插件的额外下拉小部件 Angular Datatable

Hide/Remove an extra dropdown widget from jQuery ColumnFIlterWidget plugin in Angular Datatable

基本上我想在这里实现两件事。我在这里使用 columnFilterWidget.js jQuery DataTable 插件进行列过滤。我在 "Excluding" 一个额外的下拉列表中遇到了一些问题,这是第 6 个 <td>,它有完整的数据表内容 HTML。目前排除第 6 列正在取消所有数据并显示空数据表

这是我的 HTML:

<table datatable="ng" dt-options="dtOptions"
    dt-instance="dtInstanceCallback" style="width: 100%" id="quoteMgmt">

    <thead>
        <tr>
            <th>Customer</th>
            <th>Origin City</th>
            <th>Origin State</th>
            <th>Destination City</th>
            <th>Destination State</th>
            <th></th> 

       </tr>
    </thead>
    <tbody>

        <tr ng-repeat="quote in mgmtQuote track by quote.quoteNumber">

            <td style="display: none">
                {{ quote.customerInfoVo.customerName }}</td>
            <td style="display: none">
                {{ quote.eqmCommonInfo.origCity }}</td>
            <td style="display: none">
                {{ quote.eqmCommonInfo.origState }}</td>
            <td style="display: none">
                {{ quote.eqmCommonInfo.destCity }}</td>
            <td style="display: none">
                {{ quote.eqmCommonInfo.destState }}</td>    

            <td>
                <div class="row">
                    <div class="seven columns">
                    [Datatable Content]

这是我的 app.js

 $scope.dtOptions = DTOptionsBuilder.newOptions()
                .withOption('sDom', 'ltip')
                .withOption('iDisplayLength', 25)
                .withOption('fnDrawCallback',function(oSettings){$(oSettings.nTHead).hide();SpinnerService.hide();})
                .withOption('aaSorting',[])
                .withLanguage({"sEmptyTable":"No quotes available"})
                .withOption("sDom", 'W<"clear">lfrtip')
                .withOption('aoColumnDefs',[{
                    'bVisible':true,'aTargets':[0,1,2,3,4]
                }])
                .withOption('aoColumnDefs',[{
                    'bVisible':false,'aTargets':[5]
                }]);

我可以通过使用不同的语法来修复它。在使用 Angular Datatable DTOptionsBuilder 时,应谨慎使用语法。发布我的答案以防万一它对某人有帮助。

   $scope.dtOptions = DTOptionsBuilder.newOptions()
                .withOption('iDisplayLength', 25)
                .withOption('fnDrawCallback',function(oSettings){$(oSettings.nTHead).hide();SpinnerService.hide();})
                .withOption('aaSorting',[])
                .withOption('bJQueryUI',false)
                .withOption('bDeferRender',true)
                .withLanguage({"sEmptyTable":"No quotes available"})
                .withOption("sPaginationType",'full_numbers')
                .withOption('sDom', 'W<"clear">lrtip')
                .withOption("aoColumns",[
                   /*0 Customer */         {"bVisible":false},
                   /*1 Origin City */      {"bVisible":false},
                   /*2 Origin State */     {"bVisible":false},
                   /*3 Desination City */  {"bVisible":false},
                   /*4 Desination State */ {"bVisible":false},
                   /*5 Equipment Type */   {"bVisible":false},
                   /*6 Entire Datatable */ {"bVisible":true},
                   /*7 Sent Date */        {"bVisible":false},
                   /*8 Expiration Date */  {"bVisible":false},
                   /*9 Awarded Date */     {"bVisible":false},
                   /*10 Awarded Date desc*/{"bVisible":false}
                 ])
                 .withOption("oColumnFilterWidgets",{
                      "aiExclude":[6,7,8,9,10],
                      "sSeparator": "\s*/+\s*",
                      "bGroupTerms": false,
                 })