--- In flexcoders@yahoogroups.com, "thisdudenamedjon" <[EMAIL PROTECTED]> wrote: > > Suppose I have a datagrid. I'd like to be able to restrict certain > editable columns from being accessed using the tab key. > > Is there a way to disable tabbing for a particular column? > try this little example (it needs more work though)
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*" initialize="startUp()"> <mx:Script> <![CDATA[ var dp = [ { one:"one", two:"two", three:"three" }, { one:"four", two:"five", three:"six" }, { one:"seven", two:"eight", three:"nine" }, { one:"ten", two:"eleven", three:"twelve" }, { one:"thirteen", two:"fourteen", three:"fifteen" }]; var restrictedCell={itemIndex:3, columnIndex:1}; var myCell; function doCellFocusIn(event:Object):Void { myCell = {itemIndex:event.itemIndex, columnIndex:event.columnIndex}; } function startUp():Void { Key.addListener(this); } function onKeyDown():Void { if(Key.isDown(Key.TAB)) { if(myCell.itemIndex == restrictedCell.itemIndex && myCell.columnIndex == restrictedCell.columnIndex) { dg.focusedCell = {itemIndex:0, columnIndex:0}; } } } ]]> </mx:Script> <mx:DataGrid id="dg" dataProvider="{ dp }" cellFocusIn="doCellFocusIn(event)" editable="true"> <mx:columns> <mx:Array> <mx:DataGridColumn columnName="one" /> <mx:DataGridColumn columnName="two" /> <mx:DataGridColumn columnName="three" /> </mx:Array> </mx:columns> </mx:DataGrid> </mx:Application> ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/