On 2007-03-13, at 18:01 EDT, Antun Karlovac wrote:
Can someone explain what canvas.datasets *should* be? It gives me
two conflicting responses. I found an earlier email thread between
Tucker and Adam saying that canvas.datasets *might* be deprecated
at some point.
I think this was prompted by the fact that datasets are named in so
many places it is easy to leak them. Do you need to have a list of
all your datasets?
I have two datasets in the canvas, and a number nested elsewhere in
my application. In the debugger, I type:
LZX> canvas.datasets
... and I get the following response:
«Object#7| {canvas_two_ds: LzDataset :canvas_two_ds, canvas_one_ds:
LzDataset :canvas_one_ds}»
What happens if you inspect this in the debugger (click on it)? Also
try `Debug.showInternalProperties = true` and inspecting. I think
you may be being fooled by the debugger printing an abbreviated
representation of the object. You have to inspect the object to see
all its members.
OK. Two datasets. So canvas.datasets is an object that contains
references to all the datasets that are immediate children of the
canvas.
Now I do:
for (var i in canvas.datasets) {
Debug.write(canvas.datasets[i]);
}
... which gives me *all* the datasets in my app; not just the ones
in the canvas;
«LzDataset#0| <child_five_ds><root/></child_five_ds>»
«LzDataset#1| <child_four_ds><root/></child_four_ds>»
«LzDataset#2| <child_three_ds><root/></child_three_ds>»
«LzDataset#3| <child_two_ds><root/></child_two_ds>»
«LzDataset#4| <child_one_ds><root/></child_one_ds>»
«LzDataset#5| <canvas_two_ds><root/></canvas_two_ds>»
«LzDataset#6| <canvas_one_ds><root/></canvas_one_ds>»
Which should canvas.datasets mean? If it means *all* the datasets
in the app, then can I rely on that, or are there plans to remove
it soon?
What should I file this bug as (if it is a bug)?
Thanks,
Antun