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

Using groupTemplate and group.template #353

Closed
tgmweb opened this Issue Jun 7, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@tgmweb

tgmweb commented Jun 7, 2017

How can I customise the header when I'm using groupTemplate?

My code is as follows:

groupTemplate: '<div class="row"><div class="col-md-3">{{group}}</div></div>',
group: {
  template: '<h2 class="searchResultType {{group}}"> {{group}}</h2>'
},

But my headings aren't wrapped in an h2, which I presumed they would be?

Am I missing/doing something wrong?

@tgmweb

This comment has been minimized.

tgmweb commented Jun 7, 2017

It's ok - using a function instead of a string seems to work:

group: {
  template: function (item) {
    return '<h2 class="searchResultType ' + item.group + '"> ' + item.group + '</h2>';
},

Thanks,

Tom.

@tgmweb tgmweb closed this Jun 7, 2017

@running-coder

This comment has been minimized.

Owner

running-coder commented Jun 7, 2017

Hey @tgmweb , I'll leave this one open and investigate why the string format was not working, it's supposed to!

@running-coder running-coder reopened this Jun 7, 2017

running-coder added a commit that referenced this issue Sep 5, 2017

@running-coder running-coder added the Bug label Sep 5, 2017

@running-coder running-coder added this to the 2.10.0 milestone Sep 5, 2017

running-coder added a commit that referenced this issue Sep 7, 2017

Version 2.10.0
Features
- #138 Add `multiselect` option
- #365 Add support for `disabled` items

Fixes
- #353 `group.template` as a string
- #367 isContentEditable always true on IE11

running-coder added a commit that referenced this issue Sep 7, 2017

Version 2.10.0
Features
- #138 Add `multiselect` option
- #365 Add support for `disabled` items

Fixes
- #353 `group.template` as a string
- #367 isContentEditable always true on IE11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment