Page 1 of 1

DataGrid editing using the PickWheel...?

Posted: Thu Oct 13, 2011 12:35 pm
by rishi
Hi All,

I've been trying to work this out for a few days, reading the forums and the docs and just searching all over the place. I'm just learning how the data grid works. It is very complicated and I don't find it very intuitive. I have DataGridHelper too and that has helped me get to the point where I can edit the DataGrid Table cells with the keyboard.

I am developing the table for some data entry into and out of MySQL, using the iPad, for internal use, not the app store. (The database part is working well).

The table has around 800 cells. Most of the values should just be numeric, in multiples of 5 (from 0 to 100), so I would think that editing with a PickWheel style list would be best. What I want is for the user to just tap on a cell, the pick list pops up, they choose a value and it is stored back into the cell.

With the DataGridHelper I have managed to get keyboard editing working. It seems to use "command EditValue" in the DataGrid group script, which in turn references "EditFieldText", but I don't know where the rest of the DataGrid scripts hide in the group...

Has anyone done this?

Can anyone show me how to use the iphonePick command to edit the cell contents of a DataGrid?

Oh, and I don't want each cell to be an Option Menu / Button. It looks terrible.

Any help appreciated!

Cheers,

Rishi.

Re: DataGrid editing using the PickWheel...?

Posted: Thu Oct 13, 2011 9:43 pm
by BarrySumpter
Start here if you haven't already seen this:

LiveCode Lessons - DataGrid
http://lessons.runrev.com/spaces/lesson ... s/datagrid

How Can I Customize The Field Editor Behavior?
http://lessons.runrev.com/s/lessons/m/d ... -Behavior-

pickwheel ipad problems?
http://forums.runrev.com/viewtopic.php?f=49&t=8071

hth

Re: DataGrid editing using the PickWheel...?

Posted: Thu Oct 13, 2011 10:13 pm
by Zryip TheSlug
rishi wrote:Hi All,

Can anyone show me how to use the iphonePick command to edit the cell contents of a DataGrid?

Oh, and I don't want each cell to be an Option Menu / Button. It looks terrible.

Any help appreciated!

Cheers,

Rishi.
Hi Rishi,

The pickwheel control is included in DGH.

1. Open the column builder
2. In the DGH's column builder, open the custom objetcs topic
3. Drag the "iOS modal pickwheel" control in the template area for the column you want to customize
4. Save the template area by clicking on the update button
5. Build the script for the column using the script builder
6. Edit the script for the column

Change the line:
put "Item 1" & cr & "Item 2" & cr & "Item 3" & cr & "Item 4" into tThePickList ## Add your list here
with the values you want for the pickwheel

Will create a lesson as soon as possible presenting this DGH feature.

Best regards,

Re: DataGrid editing using the PickWheel...?

Posted: Fri Oct 14, 2011 12:52 pm
by rishi
BarrySumpter wrote:Start here if you haven't already seen this:

LiveCode Lessons - DataGrid
http://lessons.runrev.com/spaces/lesson ... s/datagrid

How Can I Customize The Field Editor Behavior?
http://lessons.runrev.com/s/lessons/m/d ... -Behavior-

pickwheel ipad problems?
http://forums.runrev.com/viewtopic.php?f=49&t=8071

hth
Thanks Barry, yes I've been through all those links in detail... but still having trouble with it!

The "customised field editor button" method would probably work, but I still found it very complicated and have not been able to get it to work (yet).

Cheers.

Re: DataGrid editing using the PickWheel...?

Posted: Fri Oct 14, 2011 1:20 pm
by rishi
Zryip TheSlug wrote:
Hi Rishi,

The pickwheel control is included in DGH.

1. Open the column builder
2. In the DGH's column builder, open the custom objetcs topic
3. Drag the "iOS modal pickwheel" control in the template area for the column you want to customize
4. Save the template area by clicking on the update button
5. Build the script for the column using the script builder
6. Edit the script for the column

Change the line:
put "Item 1" & cr & "Item 2" & cr & "Item 3" & cr & "Item 4" into tThePickList ## Add your list here
with the values you want for the pickwheel

Will create a lesson as soon as possible presenting this DGH feature.

Best regards,
Hi Mr Slug, thank you very much for this help!

I had seen the "iOS modal pickwheel" control in the DGH column builder, but could not work out how to use it...

I have followed your steps just now, but am still having some trouble with it.
I start by selecting the column and the template area is blank.
I drag in the pickwheel control and see the outline of a rectangle.
I press the Update button and the column name appears in the template area. I also now can see that the "Select an object in the template area" option button has two objects in it: Field "_ColumnData_"[1] and Field "Field"[2]. I leave that on the default (first option), not sure if that is the right option..?
I use the option menu to the far right to "Build Script".
I get the confirmation request warning me that I am about to update the behavior script, followed by the confirmation that I might erase a custom script.
I use the option menu to the far right to "Edit Script" and the script opens to edit the behavior script for button "Column3 Behavior".
This looks as expected and I can edit the pick list in the EditValue command.
I click Apply for the script edit, good - No Errors.
I go back to the Column Builder and click the Apply button there, it confirms the intention to save the TMPL area, closes the script editor and re-sets back to selecting column one.
Not sure if anything else needs doing?
Next, check the stack in the simulator, that column is no longer displaying data (but other columns are) and also won't do anything with editing (but other columns will do the old normal keyboard editing).
It looks like I am missing something here...? Any suggestions?

It may be that I have conflicting scrip changes after some of the other things I have tried. I will try this out on a fresh data grid tomorrow, it is too late here now!

Thanks again, cheers,

Rishi.

Re: DataGrid editing using the PickWheel...?

Posted: Fri Oct 14, 2011 8:36 pm
by Zryip TheSlug
Hi Rishi,

I forgot to precise you have to delete the "_columndata_" field in order to have the pickwheel working.

The corresponding lesson will follow soon.


Best regards,

Re: DataGrid editing using the PickWheel...?

Posted: Sat Oct 15, 2011 10:58 am
by rishi
Hi again Mr TheSlug, :wink:

I tried the whole process again, deleting the "_ColumnData_" field, but still no luck.

I note that the script it gets me to edit is called button script "Column3 Behavior". When I go back into the column template area and choose Edit Script again, it opens up a script called button script "Column3 Behavior", but it is not the same script..! All the functions/commands are different and the pickwheel stuff is gone. Why would it be gone? I did Apply and Save...

It looks like I will need the lesson / tutorial..!

Thanks again for the help with this.

Cheers,

Rishi.

Re: DataGrid editing using the PickWheel...?

Posted: Sat Oct 15, 2011 3:16 pm
by Zryip TheSlug
Hi Rishi,

Here is the link to the Lesson:

http://lessons.runrev.com/s/lessons/m/4 ... -a-column-

Let me know if this lesson makes it work.


Best regards,

Re: DataGrid editing using the PickWheel...?

Posted: Tue Oct 18, 2011 12:55 pm
by rishi
Hi TheSlug,

Sorry it has taken a while to try your lesson and get back to you... been busy!

I have worked through your lesson and can get the simple example Data Grid to work with a PickWheel in the simulator, which is great thanks. The lesson is good to give me a better idea of how to work with DataGridHelper to set it all up properly.

I did find one problem with the lesson though. When I get down to the step called "Update Column Content Then Apply The Column Builder Preview To The DataGrid", I press the Update button - no problem, then I press the Apply button and BAM! my columns are gone and the Data Grid is back to looking like it did when I first created it...

I think that back in the second step, "Building Columns in the Columns Builder Preview" you need to Apply the change back to the Data Grid after you create and name each column. For example, if I make many columns (PickWheel1, PickWheel2, PickWheel3 etc) I need to Apply after each one or risk loosing one if I make too many columns at once.

Once I worked past that issue, it did work though.

I am still having trouble with this method when I try to make many columns have the PickWheel functionality. I have not had time to really investigate this yet though and it is late here now. I will look at this some more tomorrow and see if I can elaborate on this problem.

Thanks again for your help.

Regards,

Rishi.