Extracting item from datagrid by number of items

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
matgarage
Posts: 73
Joined: Sat Apr 20, 2013 11:39 am

Extracting item from datagrid by number of items

Post by matgarage » Sat May 18, 2013 10:44 am

Hello all
I get a datagrid with products
p1 TAB 2000
p2 TAB 2000
p3 TAB 3000
p4 TAB 4000
p6 TAB 5000
p7 TAB 3500

I define a number af item by group and then want to put this item, by group of the number of items, in a different field for each group

G1 = p1,p2
G2 = p3,p4
G3 = p5,p6
G4 = p7

I can't find how to do that.
An advice please ...

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

Re: Extracting item from datagrid by number of items

Post by Traxgeek » Sat May 18, 2013 2:14 pm

Hi matgarage,

Some clarification may be required here - for me anyway !

A 'DataGrid' is a (complex) LiveCode object (or rather group of objects that make up a 'control') to display a data set in a flexible way, stylised as a table or form. They're great - but (I found) rather complex to get to grips with - albeit well worth the effort once you start making progress with them ! (You can see some examples here :http://lessons.runrev.com/s/lessons/m/d ... e-examples)

Your 'datagrid' on the other hand is rather different and would appear to be a simple set of data with an identifier (say, P1) and a value (say, 2000); the two being separated by a tab delimiter...
I hope I'm doing OK so far !

I think you then wish to 'group' these data (in some way, I couldn't quite understand how) and would appear to have used a G header (say, G1, G2 etc...) as the group identifier. I think you then allocate certain data objects (products; P1 = 2000 etc) to a group (G1 etc.).

Displaying the data should be pretty simple BUT I'm not sure exactly what you're trying to achieve - could you be more specific ?

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

matgarage
Posts: 73
Joined: Sat Apr 20, 2013 11:39 am

Re: Extracting item from datagrid by number of items

Post by matgarage » Sat May 18, 2013 5:14 pm

Hi Traxgeek

You're right.In my example I just want to set a repeat loop that dispatch data in fields : the 2 first in the first field, the 2 others in the second field, ...
with the number of fields needed (number of Data divided by the number of 'seat' in my fields (2 in my example) .

I hope that it can help to understand

Post Reply