need to add a html table in my enyo code

edited October 2013 in Enyo 2
I need to add a html table in my enyo code.

I'm using
{
    kind: enyo.Control,
    tag: "div",
    allowHtml: true,
    srcId: "summaryreport"
},
and my html table is with div id = summary report

but the table is not rendering . is there any way to render a html table in enyo content ?


Comments

  • I'd say you just set the content of your control to the table... not?

    I.e.
    var table = "....."; //what ever.. do you load that from somewhere or generate it?

    this.$.someControl.setContent(table);

    maybe you'll need to call this.resized(); to reflow your layouts.
  • Alternately, if you can render the data with Enyo directly, that's going to be your best option.

    Enyo 2.3 will actually include a Table kind (and its own supporting kinds, for rows & cells, TableRow and TableCell, respectively): https://github.com/enyojs/enyo/blob/master/source/ui/Table.js

    As for why your original code does not work, the srcId attribute was an Enyo 1 property for enyo.Control, and does not exist in Enyo 2, so to achieve a similar result would require doing something like @Garfonso mentioned.
  • Enyo 2.3 will actually include a Table kind
    Thank you ! Great.
Sign In or Register to comment.