Page 1 of 1
Extracting item from datagrid by number of items
Posted: Sat May 18, 2013 10:44 am
by matgarage
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 ...
Re: Extracting item from datagrid by number of items
Posted: Sat May 18, 2013 2:14 pm
by Traxgeek
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.
Re: Extracting item from datagrid by number of items
Posted: Sat May 18, 2013 5:14 pm
by matgarage
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