alfajango / jquery-dynatable

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

Suggestion required #71

Open sundargoki opened 10 years ago

sundargoki commented 10 years ago

Hi Steve,

Can you suggest the best way to add prefix or suffix to the table header (table th) with out affecting the integer sorting option. Since I'm not able to add any dynamic text in the table reader/writer. I'm bit confused :(

For example there is an Revenue column in the table, there I wanted to add currency symbol like "Revenue ( USD $ )". This currency symbol may vary from country to country.

I wanted this column to do an integer sorting. When I try to mention this dynamic column name in the table reader or writer. It's throwing an error. :(

Simply If I execute this command $('#tableid').data('dynatable').settings.dataset.records, I don't want to see this currency symbol in my column title (Ex: 'Revenue' instead of 'Revenue-USD$' ).

Thanks for your great work (dynatable.js).

JangoSteve commented 10 years ago

You can use the data-dynatable-column attribute in the header cell:

<th data-dynatable-column="revenue">Revenue (USD $)</th>
sundargoki commented 10 years ago

Thanks Steve for your quick reply. By the way, will this solution work for IE8 and above. If not, is there any other alternate. Because I have to support the browsers from IE8 onwards. Sorry for not mentioning about this IE compatibility. :)

JangoSteve commented 10 years ago

Should work on ie8 no problem as long as your doctype is html5.

sundargoki commented 10 years ago

Perfect. Thanks Steve.