Skip to content

Using more than one TemplateRef in a datatable #1728

Answered by vtt-lair
vtt-lair asked this question in Q&A
Discussion options

You must be logged in to vote

Found a solution. The datatable finds the column where there data is the dame as the elements data:
var i = columns.findIndex(function (e) { return e.data === el.data; });

Since both are defined with data: null, it would find the tags columns everytime as it's the first column with data: null.

Changing the Tags column definition to:

       { 
          title: "Tags", 
          data: 'tags',
          defaultContent: '',
          sortable: true,
          ngTemplateRef: {
            ref: this.tagsTemplate,
          }          
        },

Fixed the issue:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vtt-lair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant