primefaces / primeui

Rich set of javascript-css only widgets
http://www.primefaces.org/primeui
278 stars 125 forks source link

Datatable: allow declarative html approach (CMS) #243

Open djmj opened 8 years ago

djmj commented 8 years ago

In case only the visual features of PrimeUI are used its not very markup friendly to define a PrimeUI datatable. Everything is defined in javascript making it unreadable and not straightforward.

It is also not very portable in case existing table markup shall be ported to PrimeUI. On our website we want to use PrimeUI datatable in our CMS at a few places, but don't do it. We simply reconstruct DOM with css classes since its more maintainable.

Feature: Allow basic html table markup to define a PrimeUI datatable.

<table>
    <thead>
        <tr>
            <th>Head1</th>
            <th>Head2</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Cell1</td>
            <td>Cell2</td>
        </tr>
    </tbody>
    <tfoot>
        <tr>
            <td>Foot1</td>
            <td>Foot2</td>
        </tr>
    </tfoot>
</table>
<script>$('script').last().prev().puidatatable();</script>