How to use the @material/data-table/foundation.MDCDataTableFoundation function in @material/data-table

To help you get started, we’ve selected a few @material/data-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pgbross / vue-material-adapter / packages / mcwv-data-table / data-table.js View on Github external
},
      setAttributeAtRowIndex: (rowIndex, attr, value) => {
        this.getRows()[rowIndex].setAttribute(attr, value);
      },
      setHeaderRowCheckboxChecked: checked => {
        this.headerRowCheckbox_.checked = checked;
      },
      setHeaderRowCheckboxIndeterminate: indeterminate => {
        this.headerRowCheckbox_.indeterminate = indeterminate;
      },
      setRowCheckboxCheckedAtIndex: (rowIndex, checked) => {
        this.rowCheckboxList_[rowIndex].checked = checked;
      },
    };

    this.foundation = new MDCDataTableFoundation(adapter);
    this.foundation.init();

    this.headerRow_ = this.$el.querySelector(`.${cssClasses.HEADER_ROW}`);
    this.handleHeaderRowCheckboxChange_ = () =>
      this.foundation.handleHeaderRowCheckboxChange();
    this.headerRow_.addEventListener(
      'change',
      this.handleHeaderRowCheckboxChange_,
    );

    this.content_ = this.$el.querySelector(`.${cssClasses.CONTENT}`);
    this.handleRowCheckboxChange_ = event =>
      this.foundation.handleRowCheckboxChange(event);
    this.content_.addEventListener('change', this.handleRowCheckboxChange_);

    this.layout();