0

I've got a problem with the footable plugin and need a quick solution. I already opened a bugticket in the github of the plugin, but maybe I get a quicker answer here.

We have many producttables with the footable plugin which are working great but one is set by the editor without data-hide-Attribute because it only has two columns and none should be hidden. And then data-class doesn't work and all other classes (footable-visible etc.) aren't set in the tbody. I generated a JSFiddle: http://jsfiddle.net/xxemtkw9/2/

The first table has the result expected (class "head" ist set to all cells in a column), table two doesn't have.

This is the code which is not working:

<table class="default">
    <thead>
        <tr class="footable-group-row">
            <th class="head" data-class="head">
                Spalte 1, data-class head
            </th>
           <th class="head">
                Spalte 2
           </th>
        </tr>
    </thead>
    <tbody>         
        <tr>
            <td>Wert 1</td>
            <td>Wert 2</td>
        </tr>
        <tr>
            <td>Wert 1</td>
            <td>Wert 2</td>
        </tr>
        <tr>
            <td>Wert 1</td>
            <td>Wert 2</td>
        </tr>
    </tbody>
</table>

It should result in the following (which is normally done by the plugin):

<table class="default">
    <thead>
        <tr class="footable-group-row">
            <th class="head" data-class="head">
                Spalte 1, data-class head
            </th>
           <th class="head">
                Spalte 2
           </th>
        </tr>
    </thead>
    <tbody>         
        <tr class="head">
            <td>Wert 1</td>
            <td>Wert 2</td>
        </tr>
        <tr class="head">
            <td>Wert 1</td>
            <td>Wert 2</td>
        </tr>
        <tr class="head">
            <td>Wert 1</td>
            <td>Wert 2</td>
        </tr>
    </tbody>
</table>

If I add data-hide in one of the it is working as expected. I think data-class should work without data-hide. Do you know how I can fix this?

Sabrina
  • 298
  • 1
  • 2
  • 7
  • Could you add a third table to the fiddle that uses data-hide? If I understand you correctly, adding data-hide makes the table render the way you want, but should require data-hide. Also, it looks like the second table in the fiddle doesn't match the code here. – Jeff Oct 17 '14 at 16:10

1 Answers1

0

Jeff, yes, you are right. data-hide renders it correctly, but it shouldn't be required.

I also opened a bug ticket and the developer was very quick with a fix: https://github.com/bradvin/FooTable/issues/287 So if you face that problem just get the newest version of the plugin.

Sabrina
  • 298
  • 1
  • 2
  • 7