Hi Alex. 
Thanks for the advice. I think I know what chain of events is leading to this 
bug.....its the appearance of the sort arrow.

When I place my mouse cursor on the bottom right corner of the column header 
(the position where the sort arrow appears) and click the header to retrieve my 
new sql. The new data is retrieved ....but at the same time, the appearance of 
the sort arrow actually triggers a DataGridHeader.MouseOut event (which leads 
to the RTE).

What iv'e done now is I disable the column (column.sortable=false) when I make 
the asynchronous call for new data. 
And then enable it (column.sortable=true) once I populate the datagrid with new 
data.

I don't see the sort arrow but that doesn't matter as this really isn't a sort. 

thanks anyway.
bod





--- In [email protected], Alex Harui <aha...@...> wrote:
>
> Probably some timing bug.  Maybe use callLater to delay the changing of the 
> data or send a fake mouseOut event.
> 
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
> 
> From: [email protected] [mailto:[email protected]] On 
> Behalf Of bhaq1972
> Sent: Monday, November 30, 2009 2:43 PM
> To: [email protected]
> Subject: [flexcoders] Re: RTE - DataGridHeader/mouseOutHandler
> 
> 
> 
> Yes. The initial dataProvider was showing all orders from the ORDER table (eg 
> select * from ORDERS).
> 
> When a user clicks the column header I want to only show orders a specific 
> type of order (eg select * from ORDERS where OrderType = 'short')
> 
> btw the column has an Image itemRenderer eg
> <myDataGridColumn dataField="OrderType" itemRenderer="mx.controls.Image" ../>
> 
> 
> --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, Alex 
> Harui <aharui@> wrote:
> >
> > Is the column set changing based on the new data?
> >
> > Alex Harui
> > Flex SDK Developer
> > Adobe Systems Inc.<http://www.adobe.com/>
> > Blog: http://blogs.adobe.com/aharui
> >
> > From: [email protected]<mailto:flexcoders%40yahoogroups.com> 
> > [mailto:[email protected]<mailto:flexcoders%40yahoogroups.com>] On 
> > Behalf Of bhaq1972
> > Sent: Monday, November 30, 2009 8:26 AM
> > To: [email protected]<mailto:flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] RTE - DataGridHeader/mouseOutHandler
> >
> >
> >
> > I'm getting this runtime error which I hope someone can help me with.
> >
> > Basically, I added a headerRelease event to my DataGrid. The plan is...when 
> > a user clicks a dg column header .... rather than sorting the rows, i plan 
> > to re-populate the datagrid with rows from a different sql database call.
> >
> > eg
> > <mx:DataGrid headerRelease="headerClicked(event)" ..
> > ..
> > public function headerClicked(e:DataGridEvent):void
> > {
> > var col:myDGColumn = this.columns[e.columnIndex];
> >
> > if(col.filter)
> > {
> > // make a different database call to populate dg dataprovider
> > }
> > }
> >
> > Now this seems to be working except sometimes (quite often actually) I get 
> > the following runtime error.
> >
> > TypeError: Error #1010: A term is undefined and has no properties.
> > at 
> > mx.controls.dataGridClasses::DataGridHeader/mouseOutHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\dataGridClasses\DataGridHeader.as:1078]
> >
> > Using the debugger, the code is dying on the following if statement (of 
> > mouseOutHandler())
> >
> > if (visibleColumns[i].sortable)
> > {
> > ...
> > in my case visibleColumns.length = 10 and i=10 .....hence the RTE.
> >
> > Can some one suggest a workaround please
> >
> > regards
> > bod
> >
>


Reply via email to