Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom config object for custom table header.html #228

Open
DanielSantiagoDev opened this issue Nov 7, 2016 · 0 comments
Open

Custom config object for custom table header.html #228

DanielSantiagoDev opened this issue Nov 7, 2016 · 0 comments

Comments

@DanielSantiagoDev
Copy link

DanielSantiagoDev commented Nov 7, 2016

Hi, this is my first issue in github, so:

I downloaded the project and needed to show or hide some columns based on external config:

I can hide the row values simply by using , but I can hide the header.So, I guess I needed a custom header.html, I made it, but I cant pass custom values in order to hide the header value. So I modified the table code to pass a "config" object, just like this: (around line 636)

                 `scope.columns.push({
                        'key': column.key,
                        'name': column.name,
                        'active': active,
                        'sortable': sortable,
                        'class': column.class,
                        'style': column.style,
                        'isSorted': isSorted,
                        'isSortedCaret': isSortedCaret,
                        'config':column.config || {} 
                    });`

Now I can do this to hide the header with a custom header template:

                  `header: [{
                        key:"viewSettings.cache",
                        name:"Cache",
                        config:{
                            hide: function(){return !($scope.activeMode == 'cdm')}
                        }
                    }]`

<th ng-repeat="column in columns track by $index" ng-class="classToShow(column)" ng-style="column.style" ng-click="sortBy(column)" ng-if="!(column.config.hide() == true)">

What do you think?Should I create a pull request with this?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant