OpenField/ExitField Handlers in Datagrid?
zryip.theslug at gmail.com
Sun Feb 27 15:25:57 CST 2011
On Sun, Feb 27, 2011 at 10:08 PM, RevList <RevList at createchsol.com> wrote:
> Peter Haworth <pete at mollysrevenge.com> on February 27, 2011 at 12:24 PM
> -0800 wrote:
>>I think you need to do this in the EditFieldText and CloseFieldEditor
>>commands in the datagrid library. I haven;t used them but they are
>>writen up in detail in Trevor's Datagrid Manual.
> I have been able to enable the menu items by adding to the EditValue
> command in the behavior script for this field
> command EditValue
> if there is a field 1 of me then
> EditFieldText the long ID of field 1 of me, the dgIndex of me, the
> dgColumn of me
> end if
> Enable menuItem 1 of button "EditMenu"
> Enable menuItem 2 of button "EditMenu"
> Enable menuItem 3 of button "EditMenu"
> end EditValue
> I don't know where or how to set the disable commands when I exit this
Try the DeleteFieldEditor event instead of CloseFieldEditor.
Here is a quote of the DataGrid API:
When editing stops (focus leaves field, user presses escape key, etc.)
the message DeleteFieldEditor is sent to the data grid. This in turn
sends CloseFieldEditor pFieldEditor to pField if the user changed the
content or ExitFieldEditor pFieldEditor if no change was made. You can
use these messages to save any changes the user made in pFieldEditor.
-Zryip TheSlug- wish you the best! 8)
More information about the use-livecode