liuwenchao / aha-table

A Polymer element for a searchable, sort-able, paginate-able, inline-editable, select-able, copy-able, removable data table or grid generated by JSON data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json dom-repeat

johanmendezb opened this issue · comments

How do you add a dom-repeat for the row data? this is what I did and it works, but I need a polymer approach.

 var themed  = document.getElementById("themed");

  var events = jQuery.ajax({
    url: '/elements/services/invoices_resume.json',
    type: 'GET',
    dataType: 'json',
    complete: function(xhr, textStatus) {
      console.log(textStatus);
    },
    success: function(data, textStatus, xhr) {
      themed.data = JSON.parse(JSON.stringify(data));
      console.log(data);
    },
    error: function(xhr, textStatus, errorThrown) {
      console.log(errorThrown);
    }
  });

If you're populating data in aha-table element, this is already the recommended approach. Polymer is used to implement custom elements, it's transparent to end user; end user should consider aha-table as same as other native element, i.e.: table, span, div.