I just tried a simple test. I created a stack, added a DG and a button. I used the example at the top of this thread to set the behavior. I then added another DG to the card. Now when I double click on either DG, the new behavior is used. Is that what you are seeing and what you are intending?
I saved the stack and quit / restarted LC. I reopened the test stack. Now, the new behavior is not applied. I created a button to apply the behavior and did so (to make the test easier to replicate). Again, both DG's get the behavior. I then created a new stack and added a DG. It also responded to the added behavior. It seems like the scope of that statement is global to me. On Fri, Jul 20, 2018 at 6:34 PM, Bob Sneidar via use-livecode < use-livecode@lists.runrev.com> wrote: > > > > On Jul 20, 2018, at 15:31 , Richard Gaskin via use-livecode < > use-livecode@lists.runrev.com> wrote: > > > > IIRC Bernd's suggestion was for global scope only, yes? That is, it > swaps the positions of the two bottom scripts shown below, and affects all > DGs running in the session. > > Actually no that is why I was saying the syntax was the complete opposite > of what you'd expect. Bernd's solution actually produces the results you > see in your diagram. The custom behavior is inserted between the datagrid > and the default behavior. Odd, huh? But I've spent the better part of the > afternoon updating each datagrid in my main form to use a one custom > behavior with code common to each, while still preserving the default > datagrid behavior. And, until I do that for each datagrid, it's own > handlers are still in effect. I tested that by putting a breakpoint at the > beginning of each selectionChanged handler, the behavior and the grid. > Until I "inserted" the custom behavior, the datagrid verson of > selectionChanged is what triggered. > > > I can't think of another way to do it, but it would be nice to be able > to overload some DGs while leaving others alone. > > See above. :-) > > Bob S > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode