Datagrid Form style and closefieldEditor

Trevor DeVore lists at mangomultimedia.com
Tue Sep 1 18:26:03 EDT 2009


On Sep 1, 2009, at 5:04 PM, Yves COPPE wrote:

> when i write such a sriipt in the datagrid behavior script of a  
> datagrid in a form style :
>
> on CloseFieldEditor pFieldEditor
>   SetDataOfIndex the dgIndex of me, the short name of me, the text  
> of pFieldEditor
> end CloseFieldEditor
>
> The text of the fld in the datagrid is not updated !!
>
> ...
>
> what is wrong ?

When calling SetDataOfIndex the data grid does not refresh itself so  
that is most likely the problem. I imagine you got the code from <http://revolution.screenstepslive.com/spaces/revolution/manuals/datagrid/lessons/4668-How-Do-I-Open-a-Table-Cell-For-Editing- 
 > and it appears the example there is incorrect.

I've updated the lesson with code that should work. Does this work for  
you?

on CloseFieldEditor pFieldEditor
    put the dgIndex of me into theIndex
    put the dgDataOfIndex[theIndex] of the dgControl of me into theDataA
    put the text of pFieldEditor into theDataA[the dgColumn] of me
    set the dgDataOfIndex[theIndex] of the dgControl of me to theDataA
end CloseFieldEditor

-- 
Trevor DeVore
Blue Mango Learning Systems



More information about the use-livecode mailing list