Hi Akshay, I understand that ur unable to get the handle of the item renderer on whom the focus has to be set. Thats why I suggested dispatching a custom event that is specific to the textfield on whom the focus needs to be set. Let me explain my suggestion again.
Consider the scenario where I have 3 dynamic columns in my datagrid. Now the focus is on the 3rd textfield of either the 1st or 2nd column. The minute the user presses TAB, an event (evt1) will be dispatched. In the listener function for evt1 u analyze which column has actually dispatched the event. Based on the source of the event, u dispatch another event evt2 for column 2 or evt3 for column 3. Every 1st textfield in the columns will have a listener corresponding to a particular event. For eg my column 2 textfield will respond only to evt2 & column 3 textfield will respond only to evt3. Since this event listner will be written directly in the file where the renderer code has been written, u wont need the handle of the renderer. You will be able to directly access the textfield from the listener function. When the evt2 is caught u just set focus to the 1st textfield of column 2 and incase of evt3 u set focus to the 1st textfield of column 3. This is what i meant by "Since the event will be unique only one textfield will respond to that". What I understand from ur post is that u are trying to directly assign focus to the corresponding textfield after the tab event which will be difficult since I am unaware how to get the handle for the item renderer from the outside. I think u cannot assign an id for the item renderer so it will be difficult to access the inner textfields from the outside. Also note that this is the crudest way possible of coding this scenario but it should resolve ur problem. On Apr 19, 4:53 pm, Akshay Ransing <[email protected]> wrote: > "Since the event will be unique only one textfield will respond to > that" is not true. > I have this event listener in renderer so to call > obj.dispatchEvent(cutomEvent); > I need object obj of renderer for that particular cell next to my old > cell in DG. > How to get object of itemrenderer for particular cell ? > > On Apr 19, 3:23 pm, Kronos <[email protected]> wrote: > > > Hi Akshay, > > > I have a suggestion but I dont think u will like it. It works on > > your own logic that u have stated. > > > What u were doing is that after every tab event from Textfield3 you > > were dispatching an event. > > Now in the event listener function, u are able to get the next > > rowIndex & columnIndex. So based on the appropriate values dispatch > > another event which will correspond to that column & row's Textfield1. > > Since the event will be unique only one textfield will respond to that > > event & u can assign focus on the textfield that responded to the > > event. > > > Its not the best way but I think it should work. > > Note: It also hardcodes the event with the row & column combination. > > > On Apr 19, 12:43 pm, Akshay Ransing <[email protected]> wrote: > > > > thanks for reply but I guess You dont understand problem completely. > > > > 1 > I have renderer with 3 textfields init, first I need to travel it like > > > text1 to test2 thne text2 to text3. > > > I can do it its really simple problem starts from here. > > > 2 > when I have focus on text3 of my renderer and i press tab i need to > > > move > > > my focus to next column's cell on same row. > > > also my next column have same renderer and these columns are dynamically > > > added to my grid as per database relation. > > > > my logic was to dispatch a event from renderer when i click tab from text3 > > > of renderer to grid level mxml. > > > and i this function I can know which rowIndex and columnIndex I got call. > > > but I dont find way to assign focus to next cell by giving > > > rowIndex,columnIndex for it. > > > > On Tue, Apr 19, 2011 at 12:13 PM, xelf <[email protected]> wrote: > > > > Hi Akshay, > > > > > Option 1: > > > > Try to give tab index for each component which am not sure, just > > > > giving a thought. > > > > > Option 2: > > > > There is a workaround for solving this issue, but this inlvolves lot > > > > of coding. > > > > > 1. In your data provider add a field to monitor and assign the current > > > > focus. > > > > 2. Whenever there is a change uin focus, inside your item renderer you > > > > have to assign the current focus appropriately in the field, this will > > > > help you identify the exact focus insidedatagrid. > > > > 3. Inside itemrenderer, you have to explicitly assign the focus for > > > > Textinputs. (Ex: if focus is in TextInput1, 'onFocusOut' of > > > > TextInput1, you have to assign the field values. > > > > 4. Once there is any change dataChangeEvent will be dispatched or else > > > > yiou can dispatch any custom event. > > > > 5. In each component there should be a listerner to set focus. > > > > 6. In this case, OnFocusOut of TextInput1, event have to be dispatched > > > > and currentFocus field should refer TextInput2, then focus will be > > > > assigned to TextInput2, in event listerteners. > > > > > This procedure have to be taken care for all components used inside DG > > > > to get the expected flow. > > > > > Thanks, > > > > Sam > > > > > On Apr 18, 11:33 am, Akshay Ransing <[email protected]> wrote: > > > > > Hi, > > > > > > I have a data grid with dynamic columns and dynamic rows. > > > > > Each columns have same item renderer which is custom made with 3 text > > > > > inputs. > > > > > > My problem is I want to travel between cells but my tab should work > > > > > like for each cell it should travel from 1st to 3rd text input from > > > > > rendere and from 3rd text input to next cell. > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups > > > > "Flex India Community" group. > > > > To post to this group, send email to [email protected]. > > > > To unsubscribe from this group, send email to > > > > [email protected]. > > > > For more options, visit this group at > > > >http://groups.google.com/group/flex_india?hl=en. > > > > -- > > > Thanks & regards > > > Akshay Ransingwww.enovate-it.com > > > we care. we help you all to win. -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

