Datagrid Help... @#$%&^**

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Datagrid Help... @#$%&^**

Post by NigelS » Mon Sep 30, 2013 3:33 pm

I'm somewhat disillusioned with the data grid. I cannot for the life of me fathom this control out. I want to place a button in a column and place an icon following the demo available from RR. I follow the example step by step and I cannot get it to work. I have noticed that there are slight difference in the datagrid between the demo and the community version. 6.1.2(rc 1). It's really frustrating. I've watched the video countless times. I've also followed the manual step by step and that too has variations.

I'm using the table layout and not the form. Please don't tell me to use the "form" as this is not what I'm looking for.

Can someone please point me to some examples that work, I would be most grateful.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Datagrid Help... @#$%&^**

Post by Klaus » Mon Sep 30, 2013 3:57 pm

Hi Nigel,

don't shoot the messenger, but Datagrids of kind TABLE can only display text in FIELDS!
For buttons and other nice stuff in a ROW you need it to be of kind FORM.

BUT mayve you can simply "fake" the look by using a field and set its first char's imagesource?
This requires a custom behavior for your datagrid rows however.

And yes, datagrids a evil bests!


Best

Klaus

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Datagrid Help... @#$%&^**

Post by NigelS » Mon Sep 30, 2013 4:11 pm

Well, not according to the manual and the demo!!!!!!

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Datagrid Help... @#$%&^**

Post by NigelS » Mon Sep 30, 2013 4:17 pm

I've got version 5.5.3 and the datagrid helper and that works but not in the community version. I'm somewhat confused by this. I'm trying to introduce LC at work by doing a small project and this is holding me up. I'm using the community version to do the application in as they develop MS while my personnel one is IOS version. But still, I'm of the understanding that they are the same, par that you can't compile for pad's and mobile phones
Last edited by NigelS on Mon Sep 30, 2013 4:52 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Datagrid Help... @#$%&^**

Post by dunbarx » Mon Sep 30, 2013 4:18 pm

Klaus is right about the "table" style being suitable only for text. Before you give up, have you turned to the "form" style? The lessons, manual and demo are all for nought if you are using the wrong one.

Datagrids take getting used to, since they are composite objects and almost have a language (and mind) of their own, though it really is all LC.

Craig Newman

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Datagrid Help... @#$%&^**

Post by Klaus » Mon Sep 30, 2013 4:33 pm

NigelS wrote:Well, not according to the manual and the demo!!!!!!
Do you have an url to this?

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Datagrid Help... @#$%&^**

Post by NigelS » Mon Sep 30, 2013 4:35 pm

I'm not trying to be pain in the ass. I've included some screen shots of the example and one can clearly see that a table is been used. This was taken from the demo.
Attachments
Screen Shot 2013-09-30 at 5.34.34 PM.png
Screen Shot 2013-09-30 at 5.24.42 PM.png

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Datagrid Help... @#$%&^**

Post by NigelS » Mon Sep 30, 2013 4:45 pm

This may help shed some light on the subject (notice, it refers to tables)

http://lessons.runrev.com/s/lessons/m/d ... -s-columns

Shalom

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Datagrid Help... @#$%&^**

Post by bangkok » Mon Sep 30, 2013 7:03 pm

Check this stack. It could give you some ideas and reverse engineering :

http://forums.runrev.com/viewtopic.php? ... 540#p78299

Coffee1633
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 219
Joined: Mon Dec 05, 2011 5:35 pm

Re: Datagrid Help... @#$%&^**

Post by Coffee1633 » Tue Oct 01, 2013 3:15 am

I sympathize with you Nigel. It has been a long difficult road to even get to my limited understanding of data grids.

I thought I would ask a further question about showing/hiding a delete button in any given row and then having that delete button delete the row it's in if pressed. I asked in a different thread but I couldn't get the code that was suggested to work for the life of me.

I can get data in and out of rows and get the rowIndex and I can put a delete button in the row template but can't get the button to show or hide or do anything for the life of me. Any advice?

If I ever get this "slide to delete" working in a data grid I swear I am going to post it in the share section.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Datagrid Help... @#$%&^**

Post by Klaus » Tue Oct 01, 2013 12:04 pm

Hi Nigel,
NigelS wrote:This may help shed some light on the subject (notice, it refers to tables)
http://lessons.runrev.com/s/lessons/m/d ... -s-columns
Shalom
Oh, they really use a TABLE datagrid there!? :shock:

Sorry, I did not know this and never worked this way,
so I cannot give you any hint here...


Best

Klaus

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Datagrid Help... @#$%&^**

Post by Traxgeek » Tue Oct 01, 2013 1:58 pm

Hi coffee 1633,

Likewise, (as per Klaus's comment) I found DGs difficult beasts.

I may be able to help you though with regards a button doing something specific. When you say you can't get the button to show... do you mean you can't display the button within a row of your DG form or that you simply can't trap a user clicking on it ?

Maybe I haven't fully understood your post but (if I did, then...) :

place the following script in the behaviour script of your DG :

on mouseup pMouseButtonNum
local sTarget

put the target into sTarget
if pMouseButtonNum = 1 then
if "btnMyButton" is in sTarget then --where 'btnMyButtonName' is the name of your control: button, image...
-- Do something here
end if
end if
end mouseup

I haven't tried to delete a row but... that shouldn't be too onerous either...

Shout if this helps and you'd like a further 'push'...

HTH

Regards
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

NigelS
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sat Oct 22, 2011 2:37 pm

Re: Datagrid Help... @#$%&^**

Post by NigelS » Tue Oct 01, 2013 8:27 pm

Hi All

Been away at the coast for a break and was using the opportunity to resolve this issue which has been going on for some time. I really need to crack this thing. Anyway, flew back today and only now have managed to look at the reply's. Thanks to all for contributing.

I'll keep this line open and see how far I can get with it. What really has got me twisted with the datagrid is that I'm a professional developer using C# and ASP.NET and this little monster has got (may I dare say it) nickers in a twist. Makes me really angry at myself for not having resolved it by now.

All I can say is "chin up old boy"

Cheers
Nigel

Post Reply