Datagrids and Nested Behaviors
bobsneidar at iotecdigital.com
Fri Jul 20 23:05:03 CEST 2018
So far as I have been able to ascertain, "me" always refers to the original object, and NOT the behavior. As Jacques so helpfully pointed out, "this me" refers to the behavior's own script. So "me" might be thought of as a synonym for "the target" (insofar as I have been able to work it out).
I've been working with nested behaviors for a datagrid the better part of this day, since discovering how to do it, (thank you Bernd for your input on this) and the datagrid default behavior seems to be working as advertised, and behaving exactly as your diagram describes.
> On Jul 20, 2018, at 13:26 , Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> I just realized why the method most useful for controlling scope won't actually work.
> For scoping, we want only some DGs to have custom behavior, so this would seem most desirable:
> [ DataGrid ]
> [ Custom Behavior ]
> [ Standard DG Behavior ]
> Useful as that it for limiting scope, the problem is that much of the DG code refers to objects within "me", and in this setup "me" refers to the Custom Behavior object rather than the original DG group. No subgroups, fields, or anything else the DG expects to find are present in the Custom Behavior object, resulting in script errors.
> So the only way I can see this working at all is to toss scope control out the door and swap the Custom Behavior to be the behavior object for the Standard DG Behavior, as I believe Panos had suggested earlier.
More information about the use-livecode