Help with datagrid behavior script(attempting to have many)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 10
- Joined: Thu Jul 07, 2016 6:44 am
Help with datagrid behavior script(attempting to have many)
Hello! In my stack i have several cards that use datagrids. for each i wrote a customized behavior script. the problem is that the behavior overwrite eachothers. I mean, not overwrite but more like i cant have several of them, just one centralized one. i would like to have several localized behavior scripts instead. in the livecode lessons i found something similar, a way to locally overwrite the Field Editor of a datagrid. But i didnt find a way to do this with the behavior script.
Any ideas?
Thanks in advance!
Karen
Any ideas?
Thanks in advance!
Karen
Re: Help with datagrid behavior script(attempting to have ma
How are you trying to get into the script? Do you understand the difference between object scripts and behavior scripts?
You should be editing the object script of each of the datagrids. Right-click on the datagrid and select "Edit Script". The script editor should be empty, and the tab should say 'group "dataGrid 1".
If you are editing the behavior script for the datagrid, you are editing the shared behavior for all datagrids in your project.
You should be editing the object script of each of the datagrids. Right-click on the datagrid and select "Edit Script". The script editor should be empty, and the tab should say 'group "dataGrid 1".
If you are editing the behavior script for the datagrid, you are editing the shared behavior for all datagrids in your project.
-
- Posts: 10
- Joined: Thu Jul 07, 2016 6:44 am
Re: Help with datagrid behavior script(attempting to have ma
yes!! i've been editing the wrong script then!! thank you so much!!
Another question... same thing happens with the row template, how do i fix that?
Another question... same thing happens with the row template, how do i fix that?
Re: Help with datagrid behavior script(attempting to have ma
Did you possibly copy/paste the same DG on multiple cards?
-
- Posts: 10
- Joined: Thu Jul 07, 2016 6:44 am
Re: Help with datagrid behavior script(attempting to have ma
Actually yes, I did that. but then an error appeared and i deleted the datagrids and made individual ones. Now im trying to do as you said, but i cant get the datagrid to execute the object script i put, instead of the default behavior one. So im trying to follow the lesson of "How Do I Override the Default Behavior For Rendering Data to a Cell?" but i get an error in the message box. i change it from the "default column behavior" that is used in the example, to "behavior script" which is what appears next to row behavior in the second tab of the inspector when im selecting the datagrid.
Im sure im making some foolish mistake, im in in this afterall, so your help is greatly appreciated!
Im sure im making some foolish mistake, im in in this afterall, so your help is greatly appreciated!
Re: Help with datagrid behavior script(attempting to have ma
Well, post the stack, so we can have a look at it.
-
- Posts: 10
- Joined: Thu Jul 07, 2016 6:44 am
Re: Help with datagrid behavior script(attempting to have ma
Here's the troublesome card. seriously, thanks for helping me!
- Attachments
-
- datagrid.rar
- (4.71 KiB) Downloaded 255 times
Re: Help with datagrid behavior script(attempting to have ma
So what are we trying to do? I see you don't have the column behavior set. You have to
to make the script of the button the behavior script. That's on page 127.
Code: Select all
set the dgprops["default column behavior"] of group "dataGrid 1" to the long id of selObj()
-
- Posts: 10
- Joined: Thu Jul 07, 2016 6:44 am
Re: Help with datagrid behavior script(attempting to have ma
but isnt the column behavior script only for datagrid tables? im using a form. Is it the same?
Re: Help with datagrid behavior script(attempting to have ma
LC 8.1 DP3 has just been released which has an updated version of the Data Grid docs that takes into account version 8 IDE changes. It also corrects a bug with the 'refresh data grid' button so that it now works.
To access the updated docs, open the dictionary and select the "guide" tab. You will see the DG docs there.
Also note that selecting "User Guide" from the help menu will produce a searchable pdf of all the guides in the dictionary.
To access the updated docs, open the dictionary and select the "guide" tab. You will see the DG docs there.
Also note that selecting "User Guide" from the help menu will produce a searchable pdf of all the guides in the dictionary.
Re: Help with datagrid behavior script(attempting to have ma
So what isn't working? The mousedoubleup? You didn't have your cells set as modifiable. When I changed that it worked better, too.
-
- Posts: 10
- Joined: Thu Jul 07, 2016 6:44 am
Re: Help with datagrid behavior script(attempting to have ma
I have multiple datagrids, and they where overwriting eachothers row templates and behaviors for some reason(that reason being that i had made a horrible mistake and edited the wrong script). I tried diferent things but the problems persisted. But when i open the project today it somehow had fixed itself. I havent tested it well yet, but i think it is really fixed. Thanks a lot for your help! I'll post again after doing more tests.