DataGrid2 - What do you like, what don't you like
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
DataGrid2 - What do you like, what don't you like
Hi,
I thought I'd start this thread so we can talk about the new DG2 that came with LC 9 dp 11
Overall I think it's a major step in the right direction. I developed my own version similar to this a while ago but DG2 saves me a ton of code and mine doesn't have the reorder capability.
It appears that the auto-scroll feature does not work with DG Tables. It works great on Form DGs.
The main thing that first struck me was the concept of left vs right swipe. In my mind, if I place the cursor on the right side of a row and move to the left, that’s a left swipe and it should reveal the control at the right side of the row. Or do I have things backwards? The Dictionary and the release notes seem a little mixed up.
I like the animate feature it adds a nice touch.
The enable Swipes, I think, should have a setting for Enable/Disable Left and Enable/Disable Right Swipe. Although you can turn them off and on thru code.
The swiping is a little twitchy to me. The row doesn’t always catch the edge of the left an right controls. That is something I’m sure can be adjusted.
I’ve attached a sample stack that I’ve been fooling around with. It's set up for iOS. Please let me know if it’s helpful.
I thought I'd start this thread so we can talk about the new DG2 that came with LC 9 dp 11
Overall I think it's a major step in the right direction. I developed my own version similar to this a while ago but DG2 saves me a ton of code and mine doesn't have the reorder capability.
It appears that the auto-scroll feature does not work with DG Tables. It works great on Form DGs.
The main thing that first struck me was the concept of left vs right swipe. In my mind, if I place the cursor on the right side of a row and move to the left, that’s a left swipe and it should reveal the control at the right side of the row. Or do I have things backwards? The Dictionary and the release notes seem a little mixed up.
I like the animate feature it adds a nice touch.
The enable Swipes, I think, should have a setting for Enable/Disable Left and Enable/Disable Right Swipe. Although you can turn them off and on thru code.
The swiping is a little twitchy to me. The row doesn’t always catch the edge of the left an right controls. That is something I’m sure can be adjusted.
I’ve attached a sample stack that I’ve been fooling around with. It's set up for iOS. Please let me know if it’s helpful.
Last edited by quailcreek on Wed Dec 27, 2017 11:27 pm, edited 2 times in total.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: DataGrid2 - What do you like, what don't you like
A couple of things I've noticed.
1) EditModeReorderCompleted doesn't work, at least I haven't been able to get it to work. It's in the Behavior Script of the DG on cd 1 of the stack.
2) If you open a card with a DG on it and the DG is set up to use DG2 auto scroll there is a problem with edit mode. If you open the app I uploaded in the sim or on a device, and tap the Start Editing btn the 2 editing controls will appear. If you then do a reorder (drag using the control on the right) when the drag is completed you'll get an error. If you first scroll the DG and then do the reorder, then you won't get the error.
I've uploaded an updated stack. This one has the DG I developed a while ago. It also allows a left and right swipe. Let me know what you think.
1) EditModeReorderCompleted doesn't work, at least I haven't been able to get it to work. It's in the Behavior Script of the DG on cd 1 of the stack.
2) If you open a card with a DG on it and the DG is set up to use DG2 auto scroll there is a problem with edit mode. If you open the app I uploaded in the sim or on a device, and tap the Start Editing btn the 2 editing controls will appear. If you then do a reorder (drag using the control on the right) when the drag is completed you'll get an error. If you first scroll the DG and then do the reorder, then you won't get the error.
I've uploaded an updated stack. This one has the DG I developed a while ago. It also allows a left and right swipe. Let me know what you think.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: DataGrid2 - What do you like, what don't you like
Doen't work at all... Continuous crashes...
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: DataGrid2 - What do you like, what don't you like
I would like to follow the progress on those. What are the bug report numbers?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: DataGrid2 - What do you like, what don't you like
You can file a bug report for someone else's sample stack not working? I thought Max was referring to the file quailcreek attached, I could be wrong thoughFourthWorld wrote: ↑Wed Dec 27, 2017 5:13 pmI would like to follow the progress on those. What are the bug report numbers?
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: DataGrid2 - What do you like, what don't you like
MaxV,
My stack requires LC 9.0.0 dp11 and xCode 9.2. Is this what you're running?
The only error I get is the one I described regarding reordering.
Richard,
Have you tested my sample stack?
My stack requires LC 9.0.0 dp11 and xCode 9.2. Is this what you're running?
The only error I get is the one I described regarding reordering.
Richard,
Have you tested my sample stack?
Last edited by quailcreek on Thu Dec 28, 2017 9:46 pm, edited 1 time in total.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: DataGrid2 - What do you like, what don't you like
Crashes are different from what the OP reported, and considered critical. If the OP isn't seeing the crashes that Max reported here hopefully Max will be able to submit the recipe for those to the bug DB.bogs wrote: ↑Wed Dec 27, 2017 5:20 pmYou can file a bug report for someone else's sample stack not working? I thought Max was referring to the file quailcreek attached, I could be wrong thoughFourthWorld wrote: ↑Wed Dec 27, 2017 5:13 pmI would like to follow the progress on those. What are the bug report numbers?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: DataGrid2 - What do you like, what don't you like
Briefly. Not seeing what you reported, because I'm not seeing anything at all - the DG renders empty on my machine (v9dp11, Ubuntu 14.04).
I'll poke around to see if I can pin down what's happening with this....
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: DataGrid2 - What do you like, what don't you like
Hi Richard,
My second sample stack has 3 DGs in it. The first uses the DG2 features only.
The second DG is a table DG set to use auto scroll. Not working.
The third uses only the "WorkingRect" from the DG2 stuff. It's in the Behavior Script of the DG. I had to incorporate this to help with the scroll and swipe to keep the controls in the DG positioned correctly. I didn't need anything like that in my DG before DG2 happened.
Are all 3 of the DGs not showing data?
I did have the same issue you mentioned with a form DG not firing the Behavior Script. I beat on the problem for over an hour. Then I recreated the DG using the exact same code and the same controls in the Row Template and viola, it started working. Could be a bug but I haven't tested to see if I can recreate it.
Here are three of the bug reports I've filed:
http://quality.livecode.com/show_bug.cgi?id=20809
http://quality.livecode.com/show_bug.cgi?id=20808
http://quality.livecode.com/show_bug.cgi?id=20799
My second sample stack has 3 DGs in it. The first uses the DG2 features only.
The second DG is a table DG set to use auto scroll. Not working.
The third uses only the "WorkingRect" from the DG2 stuff. It's in the Behavior Script of the DG. I had to incorporate this to help with the scroll and swipe to keep the controls in the DG positioned correctly. I didn't need anything like that in my DG before DG2 happened.
Are all 3 of the DGs not showing data?
I did have the same issue you mentioned with a form DG not firing the Behavior Script. I beat on the problem for over an hour. Then I recreated the DG using the exact same code and the same controls in the Row Template and viola, it started working. Could be a bug but I haven't tested to see if I can recreate it.
Here are three of the bug reports I've filed:
http://quality.livecode.com/show_bug.cgi?id=20809
http://quality.livecode.com/show_bug.cgi?id=20808
http://quality.livecode.com/show_bug.cgi?id=20799
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: DataGrid2 - What do you like, what don't you like
True, none.
I can't recreate it from scratch either, but in the demo you posted none seem to have data. How are those populated?I did have the same issue you mentioned with a form DG not firing the Behavior Script. I beat on the problem for over an hour. Then I recreated the DG using the exact same code and the same controls in the Row Template and viola, it started working. Could be a bug but I haven't tested to see if I can recreate it.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: DataGrid2 - What do you like, what don't you like
One each cd there is a tab delimited, hidden fld named "Awards".
Code: Select all
on preOpenCard
if environment() is not "mobile" then exit to top
put fld "Awards" into tData
put turnRecordsIntoArray (tData) into theArray
set the dgData of grp "Form_DG" to theArray
send "RefreshList" to grp "Form_DG"
end preOpenCard
function turnRecordsIntoArray pData
local tHeaders,theKey
put "Name" & tab &"More" into tHeaders
-- replace "xmlerr, can't find element" with "" in theData
set the itemDelimiter to tab
repeat with x = 1 to the number of lines in pData
repeat with y = 1 to the number of items in tHeaders
put item y of line x of pData into theKey[x][item y of tHeaders]
end repeat
end repeat
set the itemDelimiter to comma
return theKey
end turnRecordsIntoArray
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: DataGrid2 - What do you like, what don't you like
Ah, that first line explains it ("exit to top"). With that in place no work can be done on the desktop, everything is limited to having to run on a phone or tablet. I never work that way, so it hadn't occurred to me that the init routine would stop itself when running in LC.
Are all of the new DG features exclusively mobile? That would be a shame. The desktop has become very influenced by mobile design trends, and much of the new DG would be great there.
So now it populates, but I still can't run it - I get an error on line 22 of group "Row Template 003" - "can't find background":
Are all of the new DG features exclusively mobile? That would be a shame. The desktop has become very influenced by mobile design trends, and much of the new DG would be great there.
So now it populates, but I still can't run it - I get an error on line 22 of group "Row Template 003" - "can't find background":
Also, isn't the turnRecordsIntoArray function what the DG does when you populate it with text rather than an array?if the vis of grp "DG2 Default Right Swipe Control" OR the vis of grp "DG2 Default Left Swipe Control" then
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: DataGrid2 - What do you like, what don't you like
Glad you figured it out.
I haven't seen any documentation that would lead me to believe that DG2 is only mobile. You're right, that would be a shame.
Line 22 is only there so I could capture the mouseUp if either of the swipe controls is visible. You can comment out the mouseUp part of the code and see if that allows you to run it. Or check to make sure the names of the swipe control grps match what is there. Maybe they got renamed somehow. I've attached a screen shot of the project browser showing the cd in the datagrid template sub-stack.
As I'm sure you know, there are several ways to populate a DG.
Here's another that uses text rather than an array:
I haven't seen any documentation that would lead me to believe that DG2 is only mobile. You're right, that would be a shame.
Line 22 is only there so I could capture the mouseUp if either of the swipe controls is visible. You can comment out the mouseUp part of the code and see if that allows you to run it. Or check to make sure the names of the swipe control grps match what is there. Maybe they got renamed somehow. I've attached a screen shot of the project browser showing the cd in the datagrid template sub-stack.
As I'm sure you know, there are several ways to populate a DG.
Here's another that uses text rather than an array:
Code: Select all
put fld "Awards" into tData
put "Name" & tab & "Info" & cr into TheTextData
put tData after TheTextData
set the dgText [true] of grp "Table_DG" to TheTextData
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: DataGrid2 - What do you like, what don't you like
I was just thinking about the swipe grps not being found. I'll bet the swipe capability is mobile only.
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14