I'm using:
SC_SNAPSHOT-2011-03-23/PowerEdition Deployment (built 2011-03-23)
Although I have observed the same behaviour in the v8 Release build, too.
Throws the error Cannot call method 'duplicate' of undefined.
But if you call setHeaderSpans after the component is drawn, no error is thrown.
It doesn't seem to matter whether the ListGrid is databound or not; or whether you provide a populated array of valid headerSpans or an empty array.
In my trying to isolate the cause, the key seems to whether the ListGrid isDrawn() at the time of calling setHeaderSpans.
The following works without error (if executed step at a time at the command line):
Many thanks
SC_SNAPSHOT-2011-03-23/PowerEdition Deployment (built 2011-03-23)
Although I have observed the same behaviour in the v8 Release build, too.
Code:
var a = ListGrid.create({autoDraw:false}); a.setHeaderSpans([]);
But if you call setHeaderSpans after the component is drawn, no error is thrown.
It doesn't seem to matter whether the ListGrid is databound or not; or whether you provide a populated array of valid headerSpans or an empty array.
In my trying to isolate the cause, the key seems to whether the ListGrid isDrawn() at the time of calling setHeaderSpans.
The following works without error (if executed step at a time at the command line):
Code:
var a = ListGrid.create({autoDraw:false}); a.draw(); a.setHeaderSpans([]);
Comment