mdDataTable icon indicating copy to clipboard operation
mdDataTable copied to clipboard

Default Column are not displayed

Open pwsebbi opened this issue 8 years ago • 1 comments

I am trying to populate the <mdt-column> inside of <mdt-header-row> dynamically with an array from controller. This piece of code doesn't seem to work properly: hide-column-by-default="c.selector_hidden" When loading the table default columns are not displayed. Some columns are set as default and are excluded from the "column-selector", so even after selecting all columns in the selector these columns are not displayed. How can i fix this?

This is the mdt-header-row:

`<mdt-header-row>
<mdt-column 
hide-column-by-default="c.selector_hidden" 
exclude-from-column-selector="c.selector_exclude" 
column-sort="c.sort" 
sortable-rows-default="c.sort_default" 
column-key="{{c.key}}"  
align-rule="{{c.align}}" 
column-definition="{{c.definition}}" 
ng-repeat="c in tableHeader"><span>{{c.name}}</span></mdt-column>
</mdt-header-row>`

The Data is comming from this Array in controller:

$scope.tableHeader = [
        {
            name: 'Dessert (100g serving)',
            definition: '',
            align: 'left',
            sort: true,
            sort_default:false,
            hidden: false,
            selector_exclude:false
        },...

I also created a fork for it: https://codepen.io/anon/pen/JJQyKN?editors=1111

pwsebbi avatar Jul 19 '17 22:07 pwsebbi

+1

singhay avatar Jul 25 '17 21:07 singhay