如果列的所有字段在bootstrap-table中为null,则隐藏列?

时间:2016-06-10 05:13:35

标签: javascript angularjs bootstrap-table

我在Angularjs应用程序中使用bootstrap table。我们可以通过将其visible属性设置为false来隐藏列,但现在我必须隐藏列,如果该列的所有字段都为null。那么有人可以建议我怎么做吗?

代码JS文件:

$scope.mediaTableControl = {
  options: {
    data: $scope.medias,
  },
  columns: [
    {
      field: 'DisplayId',
      title: 'Media Id',
      align: 'center',
      valign: 'bottom',
      sortable: true,
      formatter: mediaIdFormatter
    },
    {
      field: 'Created',
      title: 'Date Received',
      align: 'center',
      valign: 'middle',
      formatter: dateFormatter,
      sortable: true
    }
  ]
};

HTML文件代码:

<table bs-table-control="datasetTableControl" id="datasetTable"></table>

0 个答案:

没有答案
相关问题