gaf3
02-08-2005, 05:22 AM
Heyas,
I have a really bizarre problem. I've been extending the built in components so as I can set things like font, colors, all in the component properties panel. I just want to separate form from function, rather than have to compile every time I want to see what something looks like.
So I'm at the DataGrid component (after sucessfully overriding things like List, Button, ComboxBox, etc.) and I thought it would be a good idea to display a sample of what would be display. So I have a boolean flag (_sample) with the
getter/setter functions, and when sample is true, it creates a couple of columns and throws in two rows, false, kills everything.
Here's the annoying part. If the setSample function is called from the constructor and the default is true, it creates the columns and rows. If I set it to false and then set it back to true, I get the columns, but no rows.
Now here's the weird part. I thought I'd not destroy the data when set to false, and really do nothing. The rows disappeared anyway!!!
Now here's the compeltely totally bizarre part. I tried to debug things with trace and the dataProvider, and that made the entire component blank, just by adding some traces!!! What the heck is going on?!?!!?
Here's the code for setSample():
// Sets up a sample
private function setSample() {
trace('before');
trace(this.dataProvider);
if (_sample) {
this.addColumn("apple");
this.addColumn("orange");
this.addItem({apple:"Golden", orange:"Florida"});
this.addItem({apple:"McIntosh", orange:"California"});
} else {
this.removeAllColumns();
}
trace('after');
trace(this.dataProvider);
}
Oh, this is just in a class that extends the DataGrid class and adds some internal vars, getter/setters. So it's no big deal. I"m just wondering if I'm setting the DataGrid values wrong or it's a authoring/run time thing.
Thanks a bunch,
Gaf
I have a really bizarre problem. I've been extending the built in components so as I can set things like font, colors, all in the component properties panel. I just want to separate form from function, rather than have to compile every time I want to see what something looks like.
So I'm at the DataGrid component (after sucessfully overriding things like List, Button, ComboxBox, etc.) and I thought it would be a good idea to display a sample of what would be display. So I have a boolean flag (_sample) with the
getter/setter functions, and when sample is true, it creates a couple of columns and throws in two rows, false, kills everything.
Here's the annoying part. If the setSample function is called from the constructor and the default is true, it creates the columns and rows. If I set it to false and then set it back to true, I get the columns, but no rows.
Now here's the weird part. I thought I'd not destroy the data when set to false, and really do nothing. The rows disappeared anyway!!!
Now here's the compeltely totally bizarre part. I tried to debug things with trace and the dataProvider, and that made the entire component blank, just by adding some traces!!! What the heck is going on?!?!!?
Here's the code for setSample():
// Sets up a sample
private function setSample() {
trace('before');
trace(this.dataProvider);
if (_sample) {
this.addColumn("apple");
this.addColumn("orange");
this.addItem({apple:"Golden", orange:"Florida"});
this.addItem({apple:"McIntosh", orange:"California"});
} else {
this.removeAllColumns();
}
trace('after');
trace(this.dataProvider);
}
Oh, this is just in a class that extends the DataGrid class and adds some internal vars, getter/setters. So it's no big deal. I"m just wondering if I'm setting the DataGrid values wrong or it's a authoring/run time thing.
Thanks a bunch,
Gaf