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.

How to get `dataKey` from object

See original GitHub issue
var columns = [
  {title: 'Test', 'dataKey': 'address.test'}
  // ...
];

var data = [
  {address: {test: 'value'}},
  {address: {test: 'value 2'}},
];

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
simonbengtssoncommented, Apr 21, 2016

Nope it matches what I posted above. You would have to flatten your object before passing it to the plugin.

1reaction
Purush0thcommented, Apr 21, 2016

Or do a map @marioidival

var exportData = data.map(function(item){
return item.address;
});
var columns = [
  {title: 'Test', 'dataKey': 'test'}
  // ...
];
Read more comments on GitHub >

github_iconTop Results From Across the Web

Get DataKey values in GridView RowCommand - Stack Overflow
I have a GridView with an associated DataKey , which is the item ID. How do I retrieve that value inside the RowCommand...
Read more >
DataKey.Value Property (System.Web.UI.WebControls)
// Get the DataKey object for the current record. DataKey key = CustomerDetailsView.DataKey; // Display the value of the key field. ; "The...
Read more >
how can i get DataKey value in UI for ASP.NET AJAX - Telerik
Hello, Use the "GetDataKeyValue" method to get the keyvalue of GridDataItem. Code: Label16.Text = GridView1.MasterTableView.Items[0].
Read more >
Get value of DataKeyNames (DataKeys) in RowCommand ...
The row index can be easily determined using the Row.RowIndex property of GridViewRowEventArgs object and using the row index, the DataKey values can...
Read more >
How to get the datakey value in DetailsView control - VKinfotek
string ID = ItemsDetailsView.DataKey[0].ToString(); We can use the above code in the DataBound event of the DetilaView control to retrieve the DataKeys. 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