EditTextField in Datagrid

Trevor DeVore lists at mangomultimedia.com
Mon Jul 20 11:46:25 EDT 2009


On Jul 20, 2009, at 10:36 AM, Josep wrote:

> 1) Trap when the user press a combo keys editing some cell into the  
> datagrid
> to show one stack -- OK
> 2) One time the stack are showed the user select one value from it  
> and close
> the stack -- OK
> 3) The value selected will be "put into" the editing cell. -- NOK
>
> The value selected from the stack are stored into a global var, but  
> I don't
> see how put into the edited cell.

The name of the editor field that is created is defined by the  
constant kFieldEditorName in the script of btn "Data Grid" of stack  
"revDataGridLibrary".  The name is "DataGridFieldEditor". You could  
try targeting field "DataGridFieldEditor" of group DATA_GRID and see  
if that works.

The other option would be to close field editing while your dialog is  
open (dispatch "DeleteFieldEditor" to group DATA_GRID), set the value  
of the cell after the modal dialog changes and then open the cell for  
editing using EditCellOfIndex.

Examples of using EditCellOfIndex can be found here:

How Do I Open a Table Cell For Editing?
<http://revolution.screenstepslive.com/spaces/revolution_tools/manuals/datagrid/lessons/4668-How-Do-I-Open-a-Table-Cell-For-Editing- 
 >

> Also if I control the input with the behavior the tab key to jump to  
> another
> cell don't work and the cell will be remain as edited (showing the  
> field as
> white) until click into another cell. Why?
> ...
>
> *** Code for button "b_InputControl"
>
> on rawkeydown keycode
>   Global gConcepte
>   put keycode
>   switch keycode
>      case 65472
>         go stack "ss_conceptos" as sheet
>
>         break
>   end switch
>   pass rawkeydown
> end rawkeydown

If that is all of the code for your field editor behavior then you are  
missing the necessary message handling routines for tabKey and other  
events. Try assigning the script of button "Field Editor" of stack  
"revDataGridLibrary" to your button "b_InputControl" and then add your  
rawKeyDown code to the script.

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com



More information about the use-livecode mailing list