[flexcoders] Re: Filterfunction on a XMLListCollection is misbehaving
Here is the relevant code...Without the filter function all edits are inplace without the updated record gets resorted... thanks. mx:Script ![CDATA[ . private function itemFilter (item : Object ) : Boolean { return true; } ]] /mx:Script mx:HTTPService id=xmlItems result=searchComplete(event) resultFormat=e4x contentType=application/x-www-form-urlencoded fault=httpsFault(event) useProxy=false method=POST url=items.asp/ mx:XMLListCollection id=xlcItems source={xmlItems.lastResult.item} filterFunction=itemFilter/ mx:DataGrid sortableColumns=false dataProvider={xlcItems} id=dgItems headerShift=reGroup(event) headerRelease=headerRelease(event) editable=false focusAlpha=0.0 doubleClickEnabled=true doubleClick=editItem() headerStyleName=header headerColors=[#ff,#dd] height=22 fontSize=11 left=10 right=10 top=10 alpha=1.0 bottom=10 borderStyle=solid borderColor=#bb . /mx:DataGrid --- In flexcoders@yahoogroups.com, bobignacio [EMAIL PROTECTED] wrote: Any chance you can post your source code? --- In flexcoders@yahoogroups.com, iko_knyphausen iko@ wrote: Here is the deal... I have an XMLListCollection as a dataProvider for a dataGrid, so that I can use custom sort and filterfunctions. My application provides for editing selected items (=rows) in the Grid, and when an edit is done, I update the Grid, by setting values of the selectedItem, e.g. myGrid.selectedItem.dataField = newValue; This works fine, if I have no filterFunction defined for the XMLListCollection. The updates happen inplace, the Grid is updated and the selectedItem (=row) is still highlighted, i.e. selected. The moment, I specify a filterFunction (one that returns true for all records, mind you), any update to a field in the current selectedItem will resort the Grid (no sort object specified, and the dataGrid column sort is set to false), and the item is always sorted second last in the grid. At the same time the selectedItem property is lost (set to null). I know how to disable and enableAutoUpdate (to avoid loosing the selectedItem), but it still does not explain, why the grid data gets resorted Any insight from the pros? Thanks Iko
[flexcoders] Re: Filterfunction on a XMLListCollection is misbehaving
Correction: WITHOUT the filter function all edits are inplace, WITH the filter function the updated record gets resorted... --- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote: Here is the relevant code...Without the filter function all edits are inplace without the updated record gets resorted... thanks. mx:Script ![CDATA[ . private function itemFilter (item : Object ) : Boolean { return true; } ]] /mx:Script mx:HTTPService id=xmlItems result=searchComplete(event) resultFormat=e4x contentType=application/x-www-form-urlencoded fault=httpsFault(event) useProxy=false method=POST url=items.asp/ mx:XMLListCollection id=xlcItems source={xmlItems.lastResult.item} filterFunction=itemFilter/ mx:DataGrid sortableColumns=false dataProvider={xlcItems} id=dgItems headerShift=reGroup(event) headerRelease=headerRelease(event) editable=false focusAlpha=0.0 doubleClickEnabled=true doubleClick=editItem() headerStyleName=header headerColors=[#ff,#dd] height=22 fontSize=11 left=10 right=10 top=10 alpha=1.0 bottom=10 borderStyle=solid borderColor=#bb . /mx:DataGrid --- In flexcoders@yahoogroups.com, bobignacio bobignacio@ wrote: Any chance you can post your source code? --- In flexcoders@yahoogroups.com, iko_knyphausen iko@ wrote: Here is the deal... I have an XMLListCollection as a dataProvider for a dataGrid, so that I can use custom sort and filterfunctions. My application provides for editing selected items (=rows) in the Grid, and when an edit is done, I update the Grid, by setting values of the selectedItem, e.g. myGrid.selectedItem.dataField = newValue; This works fine, if I have no filterFunction defined for the XMLListCollection. The updates happen inplace, the Grid is updated and the selectedItem (=row) is still highlighted, i.e. selected. The moment, I specify a filterFunction (one that returns true for all records, mind you), any update to a field in the current selectedItem will resort the Grid (no sort object specified, and the dataGrid column sort is set to false), and the item is always sorted second last in the grid. At the same time the selectedItem property is lost (set to null). I know how to disable and enableAutoUpdate (to avoid loosing the selectedItem), but it still does not explain, why the grid data gets resorted Any insight from the pros? Thanks Iko
[flexcoders] Re: Filterfunction on a XMLListCollection is misbehaving
Any chance you can post your source code? --- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote: Here is the deal... I have an XMLListCollection as a dataProvider for a dataGrid, so that I can use custom sort and filterfunctions. My application provides for editing selected items (=rows) in the Grid, and when an edit is done, I update the Grid, by setting values of the selectedItem, e.g. myGrid.selectedItem.dataField = newValue; This works fine, if I have no filterFunction defined for the XMLListCollection. The updates happen inplace, the Grid is updated and the selectedItem (=row) is still highlighted, i.e. selected. The moment, I specify a filterFunction (one that returns true for all records, mind you), any update to a field in the current selectedItem will resort the Grid (no sort object specified, and the dataGrid column sort is set to false), and the item is always sorted second last in the grid. At the same time the selectedItem property is lost (set to null). I know how to disable and enableAutoUpdate (to avoid loosing the selectedItem), but it still does not explain, why the grid data gets resorted Any insight from the pros? Thanks Iko