alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 361 forks source link

Templates support #154

Closed julianxhokaxhiu closed 6 years ago

julianxhokaxhiu commented 9 years ago

What about supporting some kind of templating function like AngularJS or Ember does?

It's really old school to write HTML inside JS code. it would be much better to have some options that passing an .html file formatted with mustache-like syntax, would just output the JSON data.

Something like this:

$('#my-table').dynatable({
 'template': {
   'header' : 'path/to/header.html',
   'row' : 'path/to/row.html',
   ...
 }
});

header.html

<th>Name</th>
<th>Surname</th>

row.html

<td>{ data.name}</td>
<td>{ data.surname}</td>

but also something like

header.html

<th>Name Surname</th>

row.html

<td>{ data.name} { data.surname}</td>

Thanks in advice :) Looking forward for this powerful library.

Woolfe commented 8 years ago

Did you end up writing your own workaround?

julianxhokaxhiu commented 8 years ago

Phew, this issue was created years ago and I changed totally company during that time. Honestly I never encounter this again since I never had the need to use this library again.

Although I still think would be a great addition :)