dimanche 2 août 2015

Dynamically setting component tagName

From what I've seen this isn't exactly possible by default, but I was hoping that the new Glimmer engine might be able to improve this. I'm creating an inline edit component for within a table. By default, I want the component to be a td element, but selectively become an input element on interaction.

// components/inline-edit.js
tagName: 'td',
click: function() {
    this.set('tagName', 'input');
    this.rerender(); // prolly not necessary, but thought I'd give it a go
}

Unfortunately, this does not work. Am I missing something? I'm using Ember 1.13.3, but do I need to opt into Glimmer for this to work?

Thanks.




Aucun commentaire:

Enregistrer un commentaire