lightswitch05/table-to-json

Convert tables to JSON in multiple tabs

Closed this issue · 6 comments

My problem has arisen when I use table-to-json lib combined with jQuery library "jQuery UI Tabs" to have multiple tabs within a single HTML file.
http://jsfiddle.net/ptVDm/171/
Add some more tabs and then, when you try to export(alert) the JSON object of each table in each tab (only the table of the selected tab is exported) , the rest of them are empty [] as you can see.

I would like to export all the JSON objects of each table in each tab.

Any advice would be appreciated.

Thank you in advance.

It looks like you've closed this issue. I assume that means you've fixed it?

I have the same problem. I dont no how fix that.

baw commented

I'm pretty sure this is because the other tabs' 'display' property are being set to 'none'. A table being not showing up through the 'display' property being set to 'none' currently doesn't work with the library. I'll try to look into making this work.

This example demonstrates this a little better: http://jsfiddle.net/ptVDm/219/ (it's based on the first example, but includes two tabs at the beginning instead of just one). Notice how the library works on the table that is being shown, but not the table that is hidden.

baw commented

You can use the option 'ignoreHiddenRows' for this by setting it to 'false':

$('#table').tableToJSON({ ignoreHiddenRows: false });

Here is an example of this being used: http://jsfiddle.net/ptVDm/220/

Thanks for looking into this @imamathwiz. When you get a chance, email me (email listed in profile) so we can discuss more.

@imamathwiz Thanks. It worked absolutely perfect. Hope you keep helping.