Hi everyone,
In my flex project, I have 2 widgets:
widget 1 - user input searching criteria, and when click "Ok", close widget 1 and open widget 2. widget 2 - use the searching criteria from widget 1 and display the result in a datagrid (from database).
I have successfully passed the searching criteria from widget 1 to widget 2 and the datagrid can display data according to different searching criteria in widget 1. but the datagrid cannot select a row or sorting or scrolling.
In widget 2 init() function, I add this line:
<SPAN class="pln" style="color: #000000; font-size: 13.63px;">ws</SPAN><SPAN class="pun" style="color: #000000; font-size: 13.63px;">.</SPAN><SPAN class="typ" style="color: #2b91af; font-size: 13.63px;">GetData</SPAN><SPAN class="pun" style="color: #000000; font-size: 13.63px;">(query</SPAN><SPAN class="pun" style="color: #000000; font-size: 13.63px;">);//query is from widget 1</SPAN>
In the function of getting data I use:
public function GetData(event:ResultEvent):void {
datagrid.dataProvider = null;
ws.GetData(query);
datagrid.dataProvider = event.result;
}
The problem is:
If I add the line of datagrid.dataProvider = null; The datagrid data will be refresh according to different searching criteria from widget 1, but the datagrid cannot be used properly (cannot select, sort, scroll).
If I remove the line of datagrid.dataProvider = null; the datagrid can be used properly. but the data in the datagrid will never be updated according to dfferent searching criteria. It means it always display the first time searching result.
How can make it work properly? Thanks in advance.