Re: Simple Datagrid task?
Bill I totally understand. I struggled with this a few months ago partly because it is counter intuitive that I couldn’t just enter text in a field in the DataGrid that I could edit and partly because I couldn’t figure out how to do it from the docs. Finally I found the example stack and worked it through. So I am happy to help people avoid the rut I had fallen into on this issue or help newbie’s avoid the rut. Plus if I type it out here I might find just find it again when I forget how to do it in a couple of years. That has happened more than once. Look online for a solution to a problem, find the answer and then find that I had written it. :-( Martin > On Apr 27, 2021, at 11:07 AM, William Prothero via use-livecode > wrote: > > Thanks for your help. I hate to ask such newby questions, but I’m really > busy, and what I needed to do seemed so basic. > > Best, > Bill > > William Prothero > https://earthlearningsolutions.org > >> On Apr 27, 2021, at 6:51 AM, Martin Koob wrote: >> >> Hi >> >> I wanted to give you more of an explanation of how to get enter text in >> field to work. Just refreshing my own memory I had to go back to my project. >> >> >> So as Håkan said you have to first allow editing. >> >> Then you can’t just enter text into a cell and have it deal with it. You >> have to use a Datagrid command EditTextField >> >> Here is the handler I use in my project which I adapted from the DG7 form of >> the DGForms.zip file that you can download here: >> https://forums.livecode.com/viewtopic.php?f=7&t=20130 >> >> >> >> on mouseDoubleUp pMouseBtnNum >> >> local theKey >> >> >> -- Example of how to edit the contents of a field. >> >> -- By passing the index of the record associated with copy of this template >> being displayed and >> >> -- a key (array key) the data grid will automatically save the changes the >> user >> >> -- makes and refresh the UI by calling FillInData and resizeControl. >> >> if pMouseBtnNum is 1 then >> >>if the dgProps["allow editing"] of the dgControl of me then >> >> put the short name of the target into sEditedField >> >> switch sEditedField >> >> case "RaterComments" >> >> put "CriteriaComments" into theKey >> >> EditFieldText the long id of the target, the dgIndex of me, >> theKey >> >> break >> >> case "title" >> >> put "title" into theKey >> >> EditFieldText the long id of the target, the dgIndex of >> me, theKey >> >> break >> >> end switch >> >> end if >> >> end if >> >> pass mouseDoubleUp >> end mouseDoubleUp >> >> >> —— >> >> Hope this helps. >> >> Martin Koob >> >> >>> On Apr 27, 2021, at 8:20 AM, hakan--- via use-livecode >>> wrote: >>> >>> On the second tab in the preferences pane there is a checkbox that says >>> ”Allow text editing”. If you have that selected you can edit the text by >>> double-clicking a cell. >>> >>> Or do you need something else? >>> >>> :-Håkan >>> > On 26 Apr 2021, at 21:03, William Prothero via use-livecode > wrote: Folks: I’m wanting to use a datagrid to store data that I enter by hand. Seems this oughta be quite simple, but ….. messing with the docs is frustrating. I want to be able to click on an empty cell in a datagrid, have it open, and enter a number or text. Then I want to store the values to a file. I have no problem with using dgArray to get the data and store it, but the simple act of opening a cell so I can enter a number eludes me. I’m sure there must be tutorials, but I guess I’m impatient to sort through them. When I started looking around, I see there’s a problem trying to enter data into an empty cell. I need to do this. The cells with data open and let me enter values when I double click, but ……. empty ones? Could somebody point me to a tutorial that lets me do this simple task with a datagrid? Thanks, Bill ___ 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 >> >> ___ >> 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 > >
Re: Simple Datagrid task?
Thanks for your help. I hate to ask such newby questions, but I’m really busy, and what I needed to do seemed so basic. Best, Bill William Prothero https://earthlearningsolutions.org > On Apr 27, 2021, at 6:51 AM, Martin Koob wrote: > > Hi > > I wanted to give you more of an explanation of how to get enter text in field > to work. Just refreshing my own memory I had to go back to my project. > > So as Håkan said you have to first allow editing. > > Then you can’t just enter text into a cell and have it deal with it. You > have to use a Datagrid command EditTextField > > Here is the handler I use in my project which I adapted from the DG7 form of > the DGForms.zip file that you can download here: > https://forums.livecode.com/viewtopic.php?f=7&t=20130 > > > > on mouseDoubleUp pMouseBtnNum > > local theKey > > > -- Example of how to edit the contents of a field. > > -- By passing the index of the record associated with copy of this template > being displayed and > > -- a key (array key) the data grid will automatically save the changes the > user > > -- makes and refresh the UI by calling FillInData and resizeControl. > > if pMouseBtnNum is 1 then > > if the dgProps["allow editing"] of the dgControl of me then > > put the short name of the target into sEditedField > > switch sEditedField > > case "RaterComments" > > put "CriteriaComments" into theKey > > EditFieldText the long id of the target, the dgIndex of me, > theKey > > break > >case "title" > >put "title" into theKey > >EditFieldText the long id of the target, the dgIndex of > me, theKey > >break > > end switch > > end if > > end if > > pass mouseDoubleUp > end mouseDoubleUp > > > —— > > Hope this helps. > > Martin Koob > > >> On Apr 27, 2021, at 8:20 AM, hakan--- via use-livecode >> wrote: >> >> On the second tab in the preferences pane there is a checkbox that says >> ”Allow text editing”. If you have that selected you can edit the text by >> double-clicking a cell. >> >> Or do you need something else? >> >> :-Håkan >> On 26 Apr 2021, at 21:03, William Prothero via use-livecode wrote: >>> >>> Folks: >>> I’m wanting to use a datagrid to store data that I enter by hand. >>> >>> Seems this oughta be quite simple, but ….. messing with the docs is >>> frustrating. >>> >>> I want to be able to click on an empty cell in a datagrid, have it open, >>> and enter a number or text. Then I want to store the values to a file. I >>> have no problem with using dgArray to get the data and store it, but the >>> simple act of opening a cell so I can enter a number eludes me. >>> >>> I’m sure there must be tutorials, but I guess I’m impatient to sort through >>> them. When I started looking around, I see there’s a problem trying to >>> enter data into an empty cell. I need to do this. The cells with data open >>> and let me enter values when I double click, but ……. empty ones? >>> >>> Could somebody point me to a tutorial that lets me do this simple task with >>> a datagrid? >>> >>> Thanks, >>> Bill >>> ___ >>> 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 > > ___ > 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
Re: Simple Datagrid task?
Hi I wanted to give you more of an explanation of how to get enter text in field to work. Just refreshing my own memory I had to go back to my project. So as Håkan said you have to first allow editing. Then you can’t just enter text into a cell and have it deal with it. You have to use a Datagrid command EditTextField Here is the handler I use in my project which I adapted from the DG7 form of the DGForms.zip file that you can download here: https://forums.livecode.com/viewtopic.php?f=7&t=20130 on mouseDoubleUp pMouseBtnNum local theKey -- Example of how to edit the contents of a field. -- By passing the index of the record associated with copy of this template being displayed and -- a key (array key) the data grid will automatically save the changes the user -- makes and refresh the UI by calling FillInData and resizeControl. if pMouseBtnNum is 1 then if the dgProps["allow editing"] of the dgControl of me then put the short name of the target into sEditedField switch sEditedField case "RaterComments" put "CriteriaComments" into theKey EditFieldText the long id of the target, the dgIndex of me, theKey break case "title" put "title" into theKey EditFieldText the long id of the target, the dgIndex of me, theKey break end switch end if end if pass mouseDoubleUp end mouseDoubleUp —— Hope this helps. Martin Koob > On Apr 27, 2021, at 8:20 AM, hakan--- via use-livecode > wrote: > > On the second tab in the preferences pane there is a checkbox that says > ”Allow text editing”. If you have that selected you can edit the text by > double-clicking a cell. > > Or do you need something else? > > :-Håkan > >> On 26 Apr 2021, at 21:03, William Prothero via use-livecode >> wrote: >> >> Folks: >> I’m wanting to use a datagrid to store data that I enter by hand. >> >> Seems this oughta be quite simple, but ….. messing with the docs is >> frustrating. >> >> I want to be able to click on an empty cell in a datagrid, have it open, and >> enter a number or text. Then I want to store the values to a file. I have no >> problem with using dgArray to get the data and store it, but the simple act >> of opening a cell so I can enter a number eludes me. >> >> I’m sure there must be tutorials, but I guess I’m impatient to sort through >> them. When I started looking around, I see there’s a problem trying to enter >> data into an empty cell. I need to do this. The cells with data open and let >> me enter values when I double click, but ……. empty ones? >> >> Could somebody point me to a tutorial that lets me do this simple task with >> a datagrid? >> >> Thanks, >> Bill >> ___ >> 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 ___ 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
Re: Simple Datagrid task?
Hi again Actually this is a better link for this resource. https://forums.livecode.com/viewtopic.php?f=7&t=20130 Martin Koob > On Apr 27, 2021, at 9:27 AM, Martin Koob wrote: > > HI > > Here is a great resource stack on DataGrids you can see how to perform > different actions. It has 8 different Datagrid forms showing different > aspects. See Datagrid Form 7 of the stack. > DG7: User input, user edit text, wrap text, sum column of numbers > > https://forums.livecode.com/viewtopic.php?f=7&t=20130&p=102026&hilit=datagrid+expand+rows#p102026 > > Martin > > >> On Apr 27, 2021, at 8:20 AM, hakan--- via use-livecode >> wrote: >> >> On the second tab in the preferences pane there is a checkbox that says >> ”Allow text editing”. If you have that selected you can edit the text by >> double-clicking a cell. >> >> Or do you need something else? >> >> :-Håkan >> >>> On 26 Apr 2021, at 21:03, William Prothero via use-livecode >>> wrote: >>> >>> Folks: >>> I’m wanting to use a datagrid to store data that I enter by hand. >>> >>> Seems this oughta be quite simple, but ….. messing with the docs is >>> frustrating. >>> >>> I want to be able to click on an empty cell in a datagrid, have it open, >>> and enter a number or text. Then I want to store the values to a file. I >>> have no problem with using dgArray to get the data and store it, but the >>> simple act of opening a cell so I can enter a number eludes me. >>> >>> I’m sure there must be tutorials, but I guess I’m impatient to sort through >>> them. When I started looking around, I see there’s a problem trying to >>> enter data into an empty cell. I need to do this. The cells with data open >>> and let me enter values when I double click, but ……. empty ones? >>> >>> Could somebody point me to a tutorial that lets me do this simple task with >>> a datagrid? >>> >>> Thanks, >>> Bill >>> ___ >>> 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 > ___ 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
Re: Simple Datagrid task?
HI Here is a great resource stack on DataGrids you can see how to perform different actions. It has 8 different Datagrid forms showing different aspects. See Datagrid Form 7 of the stack. DG7: User input, user edit text, wrap text, sum column of numbers https://forums.livecode.com/viewtopic.php?f=7&t=20130&p=102026&hilit=datagrid+expand+rows#p102026 Martin > On Apr 27, 2021, at 8:20 AM, hakan--- via use-livecode > wrote: > > On the second tab in the preferences pane there is a checkbox that says > ”Allow text editing”. If you have that selected you can edit the text by > double-clicking a cell. > > Or do you need something else? > > :-Håkan > >> On 26 Apr 2021, at 21:03, William Prothero via use-livecode >> wrote: >> >> Folks: >> I’m wanting to use a datagrid to store data that I enter by hand. >> >> Seems this oughta be quite simple, but ….. messing with the docs is >> frustrating. >> >> I want to be able to click on an empty cell in a datagrid, have it open, and >> enter a number or text. Then I want to store the values to a file. I have no >> problem with using dgArray to get the data and store it, but the simple act >> of opening a cell so I can enter a number eludes me. >> >> I’m sure there must be tutorials, but I guess I’m impatient to sort through >> them. When I started looking around, I see there’s a problem trying to enter >> data into an empty cell. I need to do this. The cells with data open and let >> me enter values when I double click, but ……. empty ones? >> >> Could somebody point me to a tutorial that lets me do this simple task with >> a datagrid? >> >> Thanks, >> Bill >> ___ >> 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 ___ 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
Re: Simple Datagrid task?
On the second tab in the preferences pane there is a checkbox that says ”Allow text editing”. If you have that selected you can edit the text by double-clicking a cell. Or do you need something else? :-Håkan > On 26 Apr 2021, at 21:03, William Prothero via use-livecode > wrote: > > Folks: > I’m wanting to use a datagrid to store data that I enter by hand. > > Seems this oughta be quite simple, but ….. messing with the docs is > frustrating. > > I want to be able to click on an empty cell in a datagrid, have it open, and > enter a number or text. Then I want to store the values to a file. I have no > problem with using dgArray to get the data and store it, but the simple act > of opening a cell so I can enter a number eludes me. > > I’m sure there must be tutorials, but I guess I’m impatient to sort through > them. When I started looking around, I see there’s a problem trying to enter > data into an empty cell. I need to do this. The cells with data open and let > me enter values when I double click, but ……. empty ones? > > Could somebody point me to a tutorial that lets me do this simple task with a > datagrid? > > Thanks, > Bill > ___ > 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