Skip to content
This repository was archived by the owner on Dec 4, 2019. It is now read-only.

Pass cell scope to header renderer function#274

Open
smoakey wants to merge 1 commit intoswimlane:masterfrom
Schoolrunner:feature/pass_cell_scope_to_header_renderer
Open

Pass cell scope to header renderer function#274
smoakey wants to merge 1 commit intoswimlane:masterfrom
Schoolrunner:feature/pass_cell_scope_to_header_renderer

Conversation

@smoakey
Copy link

@smoakey smoakey commented Feb 28, 2017

Currently one of the demos is showing that cellScope is passed to the headerRenderer function similar to the cellRenderer. After looking at the code it was only passing the element.

Passing scope allows user to set things on scope within the headerRenderer function which the template can use to render. Example:

columns: [
    {
        name: 'Test'
        headerRenderer: function(scope, elem) {
            scope.someObjectInCellScope = {
                value: 'Hi there'
            };

            return `<span>{{ someObjectInParentScope.value }} - {{ someObjectInCellScope.value }}</span>`
        }
    }
]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant