Simple? DG question

Pi Digital sean at pidigital.co.uk
Tue Feb 15 18:55:13 EST 2022


Sorry Phil, I meant to say that the mouse up call comes from within the grid to a handler on the card or stack script. But I’m hoping you already got that anyway. The eye widgets are on the form grid too along with the layer number and name. The FillInData handler of the form behaviour script is what changes the visible state of the widget. If you are doing this with a standard radio button, the same principle applies. 

Sean Cole
Pi Digital
eMail Ts & Cs


> On 15 Feb 2022, at 23:40, Pi Digital via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> When the user clicks on the toggle, do you have script that is overwriting the dgData or dgText and then invoking a redraw of the form? Or are you only changing the state of the graphic? Ideally you want to change the data and allow it to redraw the grid again. 
> 
> I’m coding the same myself at this very moment for a project I’m on where I want layers to be made visible and invisible. I’m allowing the user to mouseUp on an SVG widget with the ‘eye open’ iconPresetName which then calls a handler with the layer number and the target (which is the ‘visibility’ widget) which adjusts the data for the grid and rewrites to it by using ‘set the dgDataOfIndex[pLayerNum] to pVisible' or something like it. Once all the handlers are complete it redraws the grid with the updated visibility icon. 
> 
> Does that help?
> 
> Sean Cole
> Pi Digital Productions Ltd
> 
> eMail Ts & Cs
> 
> 
>>> On 15 Feb 2022, at 22:03, Phil Davis via use-livecode <use-livecode at lists.runrev.com> wrote:
>>> 
>> Hi folks,
>> 
>> I have a 'form' Data Grid where each line's data objects are:
>> - a 'question' text field whose value is set once and never changed.
>> - an 'answer' text field whose value is set by the user's interaction with a 2-state 'answer' group.
>> 
>> When the user clicks/taps the 2-state 'answer' group, its visual state changes to acknowledge the tap, and its new state (true or false) is put into the 'answer' text field. I have verified that this part works, and the toggle object is setting the value of the 'answer' text field to reflect the visual state of the toggle object.
>> 
>> My problem:
>> For some reason, the dgText and dgData of the data grid only contain 'false' as the answer values from every line in the DG, regardless of the toggle settings (and therefore the text values in the 'answer' fields). Like this:
>> 
>>   false    Fever above 100°F
>>   false    Unexplained body aches or pain
>>   false    Coughing
>>   false    Sore throat
>>   false    Chills
>> 
>> What am I missing?
>> 
>> Thanks for any insight you can offer.
>> 
>> -- 
>> Phil Davis
>> 503-307-4363
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode


More information about the use-livecode mailing list