DataGrid custom header renderer issues
I'm trying to create a DataGrid headerRenderer with a TextInput to filter the
grid from the column. The custom renderer simply has a label (with the column
header label) and then a text input, and it's all in AS, implementing IFactory,
etc. It's rendering just fine.
The issue is with the filtering - at first, I tried just adding the text box,
but as soon as I typed anything in it, the filtering logic (which must call
dataProvider.refresh() to refresh the dataGrid) caused the header to be
re-instantiated, thereby clearing the filter text input field. I later worked
around this by caching the TextInput objects elsewhere, and having the header
simply addChild on them.
However, the issue still gets in the way. The headerRenderer is reinstantiated
twice per call to refresh(), causing it to blink, and if the user types too
fast, it throws a RTE because the components haven't been instantiated yet.
Is there a way to stop this incessant re-initialization of the headerRenderer?
It doesn't seem necessary or efficient. If anyone knows or wants to help I
would be very grateful. Thanks!
|