Re: Need to populate array into datagrid

2021-08-11 Thread Bob Sneidar via use-livecode
I have seen this sort of thing before. Try setting the dgData to empty, and 
also the dgText. Further, make sure that the column names of the datagrid match 
the keys of each record in the array. 

Sent from my iPhone

> On Aug 11, 2021, at 12:52, Mark Smith via use-livecode 
>  wrote:
> 
> Skip, are you putting this into a form style or table style datagrid?
> 
> Mark
> 
> 
>> On Aug 11, 2021, at 8:18 PM, Skip Kimpel  wrote:
>> 
>> So yes, I have tried this method but I am only getting the first element to 
>> appear in the data grid ("1,2") in each row
>> None of the other details appear in the datagrid.
>> 
>> SKIP
>> 
>> On Tue, Aug 10, 2021 at 3:24 PM Mark Smith > > wrote:
>> Hi Skip, I’m not sure if this is what you are looking for but if you want to 
>> set the datagrid to display the data in an array you use:
>> 
>> set the dgData of group "DataGrid" to pDataArray
>> 
>> If your data is just delimited text you can use:
>> 
>> set the dgText of group "DataGrid" to pData
>> 
>> Either way tiggers the LayoutControl and FillInData handlers in the 
>> datagrid, so these need to be the same as (or be modified to meet) the 
>> structure of the incoming data.
>> 
>> There is more in the dictionary under dgData and dgText.
>> 
>> Mark
>> 
>> 
 On Aug 10, 2021, at 7:52 PM, Skip Kimpel via use-livecode 
 mailto:use-livecode@lists.runrev.com>> 
 wrote:
>>> 
>>> What is the best way to do this?  I have searched my old code, online
>>> results, etc and cannot find a clear cut answer.  Having said that, it has
>>> been a VERY long time since I have done this so I am part of the "use it or
>>> lose it" club right now.
>>> 
>>> Any help would be greatly appreciated!
>>> 
>>> SKIP
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com 
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode 
>>> 
>> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need to populate array into datagrid

2021-08-11 Thread Mark Smith via use-livecode
Skip, are you putting this into a form style or table style datagrid?

Mark


> On Aug 11, 2021, at 8:18 PM, Skip Kimpel  wrote:
> 
> So yes, I have tried this method but I am only getting the first element to 
> appear in the data grid ("1,2") in each row
> None of the other details appear in the datagrid.
> 
> SKIP
> 
> On Tue, Aug 10, 2021 at 3:24 PM Mark Smith  > wrote:
> Hi Skip, I’m not sure if this is what you are looking for but if you want to 
> set the datagrid to display the data in an array you use:
> 
> set the dgData of group "DataGrid" to pDataArray
> 
> If your data is just delimited text you can use:
> 
> set the dgText of group "DataGrid" to pData
> 
> Either way tiggers the LayoutControl and FillInData handlers in the datagrid, 
> so these need to be the same as (or be modified to meet) the structure of the 
> incoming data.
> 
> There is more in the dictionary under dgData and dgText.
> 
> Mark
> 
> 
>> On Aug 10, 2021, at 7:52 PM, Skip Kimpel via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> What is the best way to do this?  I have searched my old code, online
>> results, etc and cannot find a clear cut answer.  Having said that, it has
>> been a VERY long time since I have done this so I am part of the "use it or
>> lose it" club right now.
>> 
>> Any help would be greatly appreciated!
>> 
>> SKIP
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com 
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode 
>> 
> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need to populate array into datagrid

2021-08-11 Thread Skip Kimpel via use-livecode
So yes, I have tried this method but I am only getting the first element to
appear in the data grid ("1,2") in each row
None of the other details appear in the datagrid.

SKIP

On Tue, Aug 10, 2021 at 3:24 PM Mark Smith  wrote:

> Hi Skip, I’m not sure if this is what you are looking for but if you want
> to set the datagrid to display the data in an array you use:
>
> set the dgData of group "DataGrid" to pDataArray
>
> If your data is just delimited text you can use:
>
> *set* the dgText of *group* "DataGrid" to pData
>
> Either way tiggers the LayoutControl and FillInData handlers in the
> datagrid, so these need to be the same as (or be modified to meet) the
> structure of the incoming data.
>
> There is more in the dictionary under dgData and dgText.
>
> Mark
>
>
> On Aug 10, 2021, at 7:52 PM, Skip Kimpel via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> What is the best way to do this?  I have searched my old code, online
> results, etc and cannot find a clear cut answer.  Having said that, it has
> been a VERY long time since I have done this so I am part of the "use it or
> lose it" club right now.
>
> Any help would be greatly appreciated!
>
> SKIP
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need to populate array into datagrid

2021-08-10 Thread Phil Davis via use-livecode
Hi Skip,

First, make sure your array uses the format required by the datagrid. It
should be a numeric-indexed array, where each key (index) represents a
DG row (line), with that key's subkeys representing the DG columns of
the row.

Then:
set the dgData of grp "my grid" to tMyDataA

That's it!

It might be helpful to manually put a couple of lines of values into a
DG and then do something like this so you can have a visual depiction of
how the array should be organized:

-- in a test button
on mouseUp
   put the dgData of grp "my grid" into tDataA
   breakpoint
end mouseUp


Phil Davis



On 8/10/21 11:52 AM, Skip Kimpel via use-livecode wrote:
> What is the best way to do this?  I have searched my old code, online
> results, etc and cannot find a clear cut answer.  Having said that, it has
> been a VERY long time since I have done this so I am part of the "use it or
> lose it" club right now.
>
> Any help would be greatly appreciated!
>
> SKIP
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

-- 
Phil Davis
503-307-4363


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Need to populate array into datagrid

2021-08-10 Thread Mark Smith via use-livecode
Hi Skip, I’m not sure if this is what you are looking for but if you want to 
set the datagrid to display the data in an array you use:

set the dgData of group "DataGrid" to pDataArray

If your data is just delimited text you can use:

set the dgText of group "DataGrid" to pData

Either way tiggers the LayoutControl and FillInData handlers in the datagrid, 
so these need to be the same as (or be modified to meet) the structure of the 
incoming data.

There is more in the dictionary under dgData and dgText.

Mark


> On Aug 10, 2021, at 7:52 PM, Skip Kimpel via use-livecode 
>  wrote:
> 
> What is the best way to do this?  I have searched my old code, online
> results, etc and cannot find a clear cut answer.  Having said that, it has
> been a VERY long time since I have done this so I am part of the "use it or
> lose it" club right now.
> 
> Any help would be greatly appreciated!
> 
> SKIP
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Need to populate array into datagrid

2021-08-10 Thread Skip Kimpel via use-livecode
What is the best way to do this?  I have searched my old code, online
results, etc and cannot find a clear cut answer.  Having said that, it has
been a VERY long time since I have done this so I am part of the "use it or
lose it" club right now.

Any help would be greatly appreciated!

SKIP
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode