opike
opike

Reputation: 7595

Unable to drill down into a variable in Firebug

Occasionally in firebug I'm unable to drill down into a variable expression when stepping through javascript code. Sometimes it's flukey behavior and I'll refresh the page and the next time through I am able to drill down. However with some variables I'm never able to. I'll give an example:

I'm using the google visualization api and I have the following code:

var row = tableChart1.getSelection();
var test5 = queryWrapper1;

var dt = test5.currentDataTable;
var dv = test5.currentDataView;

var x = dv.getViewRowIndex(row[0].row);
var y = dt.getRowProperties(row[0].row);
alert(test5.currentDataTable.getRowProperty(row[0].row,"ticker"));

The variable that I'm not able to drill down into is y. Here's the documentation for getRowProperties() (here's the link link to documentation):

Returns: Object

Returns a map of all properties for the specified row. Note that the properties object is returned by reference, so changing values in the retrieved object changes them in the DataTable.

Any explanation as to why firebug won't let me examine the properties of the returned object would be much appreciated. Thanks.

Update: I'm using firebug 1.7.3.

Also here's a screen shot of what I'm seeing: screenshot

Upvotes: 3

Views: 148

Answers (1)

voithos
voithos

Reputation: 70632

I tried testing it a bit with some example code from Google. It's not an issue with Firebug. The object that gets returned from your call to dt.getRowProperties(row[0].row); really is empty. The documentation on getRowProperty mentions that null is returned if no such property exists. It seems that an empty object is returned for the related function getRowProperties, if there are no properties.

The properties of a row, column, or cell are used by some visualizations to change their behavior, as explained in the documentation. You have to explicitly set these properties with the relevant functions.

If you want to test it out, to prove that it isn't Firebug, change the code like so:

var row = tableChart1.getSelection();
var test5 = queryWrapper1;

var dt = test5.currentDataTable;
var dv = test5.currentDataView;

var x = dv.getViewRowIndex(row[0].row);

// Add this bit
dt.setRowProperty(row[0].row, 'foo', 'bar');

var y = dt.getRowProperties(row[0].row);
alert(test5.currentDataTable.getRowProperty(row[0].row,"ticker"));

Upvotes: 1

Related Questions