Skip to content

Instantly share code, notes, and snippets.

@sandalsoft
Last active August 29, 2015 14:02
Show Gist options
  • Save sandalsoft/d86480bfeb464273a1a7 to your computer and use it in GitHub Desktop.
Save sandalsoft/d86480bfeb464273a1a7 to your computer and use it in GitHub Desktop.
var row = {"put":{"strikePrice":12.5,"lastPrice":0,"vol":0,"bid":5.6,"expiry":"2014-09-20","openInt":0,"ask":6.5,"net":0,"type":"PUT","ticker":"I"},"call":{"strikePrice":12.5,"lastPrice":0,"vol":0,"bid":5.6,"expiry":"2014-09-20","openInt":0,"ask":6.5,"net":0,"type":"CALL","ticker":"I"}};
getCellContent: function(row) {
window.console.log('row: ' + JSON.stringify(row));
window.console.log('1: ' + row['put'].openInt);
window.console.log('2: ' + row.put.openInt);
window.console.log('3: ' + row['put']['openInt']);
return row['put']['openInt'];
}
The output:
row: {"put":{"strikePrice":12.5,"lastPrice":0,"vol":0,"bid":5.6,"expiry":"2014-09-20","openInt":0,"ask":6.5,"net":0,"type":"PUT","ticker":"I"},"call":{"strikePrice":12.5,"lastPrice":0,"vol":0,"bid":5.6,"expiry":"2014-09-20","openInt":0,"ask":6.5,"net":0,"type":"CALL","ticker":"I"}}
1: undefined
2: undefined
3: undefined
This works as expected in jsbin http://jsbin.com/lufus/1/edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment