simple-datatables icon indicating copy to clipboard operation
simple-datatables copied to clipboard

data-hidden="true" or data-sort="asc" mark up doesn't work on columns

Open ramdemi opened this issue 3 years ago • 4 comments

Hello I changed docs/1-simple.html header to... ;

    <thead>
      <tr>  
        <th data-hidden="true">Name</th>
        <th data-sort="asc">Ext.</th>
        <th>City</th>
        <th data-type="date" data-format="YYYY/MM/DD">Start Date</th>
        <th>Completion</th>
      </tr>
    </thead>

(just like saying at wiki columns article) https://github.com/fiduswriter/Simple-DataTables/wiki/columns But Name column doesn't hide and Ext column no sorting. And I couldn't see a dataset query in datatables.js. Is this a bug?

ramdemi avatar Jun 20 '21 18:06 ramdemi

I can confirm this is still broken, also on the latest version. Please see the below html as a test. The data elements are ignored fully.

<head>
    <link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" type="text/css">
    <script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" type="text/javascript"></script>
</head>
<body>
    <table class="table">
        <thead>
        <th data-hidden="true">name</th>
        <th data-hidden="true">number</th>
        <th data-hidden="true">3</th>
        <th data-sort="false">4</th>
        <th data-hidden="true">5</th>
        </thead>
        <tbody>
        <tr><td>Unity Pugh</td><td>9958</td><td>Curicó</td><td>2005/02/11</td><td>37%</td></tr>
        <tr><td>Theodore Duran</td><td>8971</td><td>Dhanbad</td><td>1999/04/07</td><td>97%</td></tr>
        </tbody>
    </table>

<script>
    let table = new simpleDatatables.DataTable(".table")
</script>
</body>
</html>```

DNWEIJ avatar Nov 19 '21 13:11 DNWEIJ

Is it maybe possible to add some comments in the readme.md on how to run the code in debug mode, to investigate what is going on? Or maybe add a test so it can be investigated? I am not that well know with setting up all that in js , but can investigate once something is in place.

DNWEIJ avatar Nov 19 '21 13:11 DNWEIJ

remove the data- for the column header and row data.

<th hidden="true" >Column Header</th>
<tr>
<td hidden="true">Content</td>

deadlypantsd avatar Jan 17 '22 08:01 deadlypantsd

remove the data- for the column header and row data.

<th hidden="true" >Column Header</th>
<tr>
<td hidden="true">Content</td>

This worked for me! Thanks

thespacedoctor avatar Sep 09 '22 15:09 thespacedoctor