Bind the Click Event on table rows.

Hello Guys,
I'm new on Enyo. I'm trying to bind click event on table row. Here is my code. Please guide me on this.
Thanks in advance.

Comments

  • require('enyo/options').accessibility = true;
    var ready = require('enyo/ready'),
    kind = require('enyo/kind'),
    Control = require('enyo/Control'),
    Repeater = require('enyo/Repeater'),

    utils = require('enyo/utils');

    var
    Table = require('enyo/Table');

    var issueData = [{ 'issue': 'Compressor Failing', 'person': 'J.T.E.', 'date': '8/10/2017' }, { 'issue': 'Temp Sensor Failed', 'person': 'J.E.M.', 'date': '3/5/2017'}];



    module.exports = kind({
    name: 'enyo.sample.TableSample',
    classes: 'table-sample',
    components:[
    { kind: Table, components: [
    {classes: 'table-header', components: [
    {classes:"issue-td", content: 'ISSUE'},
    { classes: "person-td", content: 'PERSON' },
    { classes: "date-td", content: 'DATE' },
    ]}
    ]}
    ],
    rendered : function(){
    this.inherited(arguments);
    },
    create: function () {
    this.inherited(arguments);
    var currentRow;
    for (var i=0; i<issueData.length; i++) {
    currentRow = this.$.table.createComponent({});
    currentRow.createComponent({ class: ("issue-td"), content: (issueData[i].issue)});
    currentRow.createComponent({ content: (issueData[i].person) });
    currentRow.createComponent({ content: (issueData[i].date) });
    }
    },

    });








  • Can you put this into a working JSFiddle? I think that would help people to help you.
Sign In or Register to comment.