paper-tab
その属性に基づいてを選択しようとしていdata-id
ます。私は要素を持っていますが、selected
のプロパティに変更できませんinner_tabview
。
私はポリマーを持っています:
<paper-tabs id="inner_tabview" noink="true">
<template repeat="{{item in tabNames}}">
<paper-tab data-id="{{item['id']}}"><h3>{{item['name']}}</h3></paper-tab>
</template>
</paper-tabs>
And some Dart code behind it:
selectTab(itemId) {
PaperTab item = shadowRoot.querySelector("paper-tab[data-id='" + itemId + "']");
print('Selecting: ' + itemId + ', text:' + item.text);
PaperTabs tabView = shadowRoot.querySelector('#inner_tabview');
tabView.selected = item; // This doesn't work
}
Changing the selected using an integer (index) works, but I don't know what the index should be.
Only thing I can currently think of is finding all paper-tab
elements and get the index of the correct element in that List
. But that sounds a bit silly to do so.
Any other way?