Page 1 of 1

Edit mode action control

Posted: Sun Aug 30, 2020 9:28 pm
by marksmithhfx
According to the documentation:
Use edit mode action select control to specify the action select control to display when the data grid is in edit mode. This defaults to a red stop icon. Set to empty to prevent the action select control from being displayed.
If I set it to empty, and then change my mind, how do I set it back again? (ie. what is the long id of the "edit mode action select control"?)

Thanks
m

Re: Edit mode action control

Posted: Sun Aug 30, 2020 9:48 pm
by marksmithhfx
Related question.

When the default Edit Mode Action Control (a red stop icon) is selected, a "Delete" button appears on the right. Does anyone know if we can hook into that code? I need to add some functionality to this "delete" action. And short of just disabling the whole thing and rolling my own (not terrible, but why? when you have the code sitting somewhere) I can't see a way to do it.

Cheer, and thanks
Mark

Re: Edit mode action control

Posted: Tue Sep 01, 2020 7:08 am
by Simon Knight
Re your first question:

try

Code: Select all

   get the  dgProp["edit mode action control"] of group "myDataGrid" 
   put it into field "results"
   put it into tMyVar
store it in your variable (tMyVar) for use in the future.

Oops I have just noticed that it returns a group that does not work.

Re: Edit mode action control

Posted: Tue Sep 01, 2020 8:23 am
by Simon Knight
Hi again,

So I was on the correct track : The code above will post an ID to a group in the datagrid templates. e.g.
group id 1010 of card id 1005 of stack "Data Grid Templates 1598941616835"
Copy this text (your version not mine!) and then open up the inspector on your datagrid.
Next display the custom properties and select dgProps from the drop down.
Scroll down and find "edit mode action control"
select this and paste the text you just copied.
Lastly press the refresh (datagrid) button otherwise your recent change will not be displayed.

I'm working on doing this from script and will post when I have a solution.

Re: Edit mode action control

Posted: Tue Sep 01, 2020 8:49 am
by Simon Knight
So from script you need to ensure that the custom property is set to a text value.

e.g.

Code: Select all

put "group id 1010 of card id 1005 of stack" & quote & "Data Grid Templates 1598941616835" & quote into tString
Note the use of the constant "quote" to place a double quote character into the variable tString

See the code in button reset in my crude sample stack .

S

Re: Edit mode action control

Posted: Tue Sep 01, 2020 8:33 pm
by marksmithhfx
Simon Knight wrote:
Tue Sep 01, 2020 8:49 am
So from script you need to ensure that the custom property is set to a text value.

e.g.

Code: Select all

put "group id 1010 of card id 1005 of stack" & quote & "Data Grid Templates 1598941616835" & quote into tString
Note the use of the constant "quote" to place a double quote character into the variable tString

See the code in button reset in my crude sample stack .

S
Simon, thanks for your work on this. That's tons of great information. So I was able to track down the ID of the control following your advice and have attached it. So, just to be sure, using this information I would set it back to the "stop icon" by saying:

Code: Select all

put "group id 1010 of card id 1005 of stack" & quote & "Data Grid Templates 1598001738686" & quote into it
set the dgProp["edit mode action control"] of group "DataGrid 1" to it
I'll have to give it a try. Thanks so much, I really appreciate it.

Mark

Re: Edit mode action control

Posted: Wed Sep 02, 2020 2:19 pm
by Simon Knight
Hi,

Yes I think that should work. I probably would not use the "it" variable because Livecode is free to write to it and I like to keep a close check on my variables.

best wishes

Simon