Polymer iron-data-table- Customizing Expansion - Single Item Expanded

32 Views Asked by At

I am very new to polymer I am trying to use this on polymer2.0

but not able to integrate properly the script given on the demo

document.addEventListener('WebComponentsReady', function() {
Polymer({
  is: 'custom-expansion',
  ready: function() {
    var table = Polymer.dom(this).querySelector('iron-data-table');
    var expandedItem;
    table.addEventListener('expanding-item', function(e) {
      if (expandedItem) {
        table.collapseItem(expandedItem);
      }
      expandedItem = e.detail.item;
    });
  }
});   });

my code structure is like this

class AllCourses extends Polymer.Element {
static get is() { return 'all-course'; }
static get properties() {} }

Thank You.

0

There are 0 best solutions below