Domanda

I am using a jQuery plugin named "Table-to-JSON" (http://lightswitch05.github.io/table-to-json/) in order to convert an HTML table to a JSON object. Everything works smoothly.

My problem has arisen when I use another jQuery library "jQuery UI Tabs" to have multiple tabs within a single HTML file.

On each tab I have a table. At the bottom of the page I have a save button. I would like to give the chance to users to press the save button and for each table in each tab the corresponding JSON object to be saved.

The problem is that when you press the save button, you can only save/export the JSON object of the current (selected) tab. 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 in my jsfiddle example provided below.

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

Is it a jQuery issue regarding IDs? or table-toJSON library does not work with jQuery-UI tabs?

Any advice would be appreciated.

È stato utile?

Soluzione

there's an option for the function tableToJSON called ignoreHiddenRows.

set this option to false to accomplish what you need.

here's the fiddle : http://jsfiddle.net/7t5cB/

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top