[flexcoders] Re: DataGridHeader with TextInput : text values lost on scroll
Hopeully these will help you arrive at the solution. 1. You need to override the measure and updateDisplayList function whenever u override the createChildren function. 2. I would just extend TextInput rather than AdvDataGridHeaderRender. 3. Note that data object in the HeaderRenderer is an instance of AdvDataGridColumn. Extend your own AdvDataGridColumn and have new property called myTxtValue then in the HeaderRenderer u can use binding and use it like this (data as MyAdvDataGridColumn).myTxtValue = 'sometext' 4. When using renderers (since they are recycled) always have the else block when u have if condition http://weblogs.macromedia.com/pent/archives/flex_solutions/index.html --- In flexcoders@yahoogroups.com, gaurav1146 [EMAIL PROTECTED] wrote: Hi, I have a datagrid to which I am adding a TextInput in the Header by overriding the createChildren() method of AdvancedDataGridHeaderRenderer. The problem is that when I have certain text in the header textinput and the user performs a scroll on the DataGrid the createChildren() method is called again and it creates a new TextInput. Thus whatever value the user has typed in the textinput is lost on a scroll. Is there any way I could pass the original text of the textinput to the newly created text input. TIA Gaurav
[flexcoders] Re: DataGridHeader with TextInput : text values lost on scroll
Yes, adding it to the dataProvider or keeping a separate array for the textInput values is one of the ways. But I was thinking if there could be any other way where I could read the current value from the textbox and set the new textbox to this value without storing the user entered values in an array. --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: My guess is you'll have to keep a copy of the new text in your dataprovider, as it's done that way in order to re-use the renderers for the rows and cut down on memory usage. On Tue, May 13, 2008 at 4:38 PM, gaurav1146 [EMAIL PROTECTED] wrote: Hi, I have a datagrid to which I am adding a TextInput in the Header by overriding the createChildren() method of AdvancedDataGridHeaderRenderer. The problem is that when I have certain text in the header textinput and the user performs a scroll on the DataGrid the createChildren() method is called again and it creates a new TextInput. Thus whatever value the user has typed in the textinput is lost on a scroll. Is there any way I could pass the original text of the textinput to the newly created text input. TIA Gaurav -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
Re: [flexcoders] Re: DataGridHeader with TextInput : text values lost on scroll
Maybe I'm confused, but what good would that do? Is the value the same for all records? On Tue, May 13, 2008 at 5:10 PM, gaurav1146 [EMAIL PROTECTED] wrote: Yes, adding it to the dataProvider or keeping a separate array for the textInput values is one of the ways. But I was thinking if there could be any other way where I could read the current value from the textbox and set the new textbox to this value without storing the user entered values in an array. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: My guess is you'll have to keep a copy of the new text in your dataprovider, as it's done that way in order to re-use the renderers for the rows and cut down on memory usage. On Tue, May 13, 2008 at 4:38 PM, gaurav1146 [EMAIL PROTECTED] wrote: Hi, I have a datagrid to which I am adding a TextInput in the Header by overriding the createChildren() method of AdvancedDataGridHeaderRenderer. The problem is that when I have certain text in the header textinput and the user performs a scroll on the DataGrid the createChildren() method is called again and it creates a new TextInput. Thus whatever value the user has typed in the textinput is lost on a scroll. Is there any way I could pass the original text of the textinput to the newly created text input. TIA Gaurav -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]