fooplugins / FooTable

jQuery plugin to make HTML tables responsive
https://fooplugins.com/plugins/footable-jquery/
Other
2.13k stars 638 forks source link

Loading new rows with data attributes #748

Open TomasJerrySebo opened 7 years ago

TomasJerrySebo commented 7 years ago

Is it possible to load new rows with rows.load() - http://fooplugins.github.io/FooTable/docs/examples/advanced/loading-rows.html

So the result of the row looks like follows: ? <tr data-id="9180741188" data-name="RAN Sharing 3G Data Flow Diagram" data-description="The data flow diagram explains how the data is being transformed by various modules in the program that is used by particular operator for Radio Netw." data-price="3101" data-status="30008" data-type="104" data-image="https://syntheticspheres.box.com/shared/static/dmrexul8pfe0l31qut1gpjd0wjqmr3ju.png" class="row diagram-row"><td data-id="9180741188" class="diagram-expand"><img id="remove-diagram" class="removeButton" style="width:15px;" src="//cdn.shopify.com/s/files/1/0255/1589/t/7/assets/remove.png"></td><td>9180741188</td><td style="display: table-cell;">RAN Sharing 3G Data Flow Diagram</td><td class="diagram-expand">2016-10-11 21:42:10</td><td>NO AUTHOR</td></tr>

So basically I need to add different data attributes to different elements of the row. If not could someone suggest a workaround? Thanks

AlanGreyjoy commented 6 years ago

Have you found a work around for this?

AlanGreyjoy commented 6 years ago

Since this is a a super old issue, and google brought me here, the work around is the get your data, then run it through a foreach loop and append the new row to your table.

If you use $.get you can put the loop in the .then(function()) and then setup the table in the .done(function()) of the $.get.