question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding additional data

See original GitHub issue

Hey there!

This is a very handy jQuery plugin. I wonder how could I add additional data that is not a column of the table.

For instance, there I have a column with an image where I use extractor to get the image src. In addition to the image src, I would like to add the image width and height to the generated JSON. How would I do that?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
siamkreativecommented, Jun 28, 2017

Finally got it working thanks for your precious help. Sorry for the trouble I caused 😋

1reaction
Mottiecommented, Jun 28, 2017

Actually, it is possible using the extractor (demo)

var table = $('#example-table').tableToJSON({
  extractor: function(cellIndex, $cell) {
  	var $img = $cell.find('img');
    return {
      name: $img.attr('alt'),
      width: $img.width(),
      height: $img.height()
    };
  }
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a data series to your chart - Microsoft Support
Add a data series to a chart in Excel. Show a new data series in your chart (graph) by including the series and...
Read more >
How to update or add new data to an existing Pivot Table in ...
Add your new data to the existing data table. · Click the Change Data Source button to see the following dialog box: ·...
Read more >
How to... Create Additional Data - Preppin' Data
The additional data can add a lot of context or further depth in the resulting analysis. How to create additional rows. Pivot -...
Read more >
Data Passes | T-Mobile Support
Log in to your T-Mobile account to add a data pass. Expand + the line you wish to add the data pass to....
Read more >
How to Add Data to a Pivot Table: 11 Steps (with Pictures)
1. Open your pivot table Excel document. Double-click the Excel document that contains your pivot table. It will open. 2. Go to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found