dgText vs. dgData

Bob Sneidar bobs at twft.com
Thu Jan 26 17:55:06 EST 2012


I think it is the way I go about it. I set the dgProps["column names"] to a subset of the actual columns. I don't actually hide a column (is that a property you can set for a datagrid column?) This has the distinct advantage of allowing me to keep much more data in the datagrid than I want or need to display, and yet I have that data handy when I need it. As I have mentioned before, I am using the datagrid array as a kind of poor man's writable cursor. When I am ready to update I simply pass the dgDataOfIndex[theIndex]["uniqueid"] to my update query. The user never even knows it's there. I hide encrypted password data that way too. Seems cleaner. I thought this was the way the datagrid was intended to behave. Have I stumbled across an undocumented feature? If so then please, nobody make it go away! ;-)

Bob


On Jan 26, 2012, at 2:24 PM, Pete wrote:

> Yes, very odd.  I get the same number of columns and the same data listed
> for dgtext and dgdata including all the hidden columns.  Are the columns
> that don't turn up for you in dgtext hidden or have some different
> characteristic from those that do?
> 
> I'm on LC 5.0.2 on a Mac.
> 
> Pete
> 
> On Thu, Jan 26, 2012 at 2:03 PM, Bob Sneidar <bobs at twft.com> wrote:
> 
>> Odd then that this command:
>> 
>> on datavstext
>>   put the dgText["true"] of group "dgTableData" into theResult
>>   put cr & "-----" & cr after theResult
>>   put the dgData of group "dgTableData" into theDataA
>>   put printKeys(theDataA) after theResult
>>   put theResult
>> end datavstext
>> 
>> should return this result:
>> 
>> reservationid   building        roomnumber      startdate       enddate
>> amount  clientid        clientname
>> 1       Harmony 403     2012-01-12      2012-01-15      0       0
>> 2       Harmony 404     2012-01-14      2012-01-15      0       0
>> -----
>> 1
>>    conferencename:
>>    amount: 0
>>    enddate: 2012-01-15
>>    conferenceid: 0
>>    siteid: 2
>>    baseunit: day
>>    uniqueid: 8
>>    clientid: 0
>>    starttime: 4:00 PM
>>    baseprice: 0
>>    building: Harmony
>>    clientname:
>>    discount: 0
>>    roomid: 49
>>    rnotes:
>>    startdate: 2012-01-12
>>    endtime: 10:00 AM
>>    roomnumber: 403
>>    reservationid: 1
>>    quantity: 1
>> 2
>>    conferencename:
>>    amount: 0
>>    enddate: 2012-01-15
>>    conferenceid:
>>    siteid: 2
>>    baseunit: day
>>    uniqueid: 9
>>    clientid: 0
>>    starttime: 4:00 PM
>>    baseprice: 0
>>    building: Harmony
>>    clientname:
>>    discount: 0
>>    roomid: 50
>>    rnotes:
>>    startdate: 2012-01-14
>>    endtime: 10:00 AM
>>    roomnumber: 404
>>    reservationid: 2
>>    quantity: 1
>> 
>> 
>> Bob
>> 
>> 
>> On Jan 26, 2012, at 12:43 PM, Pete wrote:
>> 
>>> Not sure what you mean by "displayed", but f you mean columns that are
>> not
>>> hidden, that's not my experience - I see hidden columns and all rows in
>>> dgText.
>>> Pete
>>> 
>>> On Thu, Jan 26, 2012 at 11:08 AM, Bob Sneidar <bobs at twft.com> wrote:
>>> 
>>>> Hi all. Here is an interesting twist on the issue of whether or not to
>> use
>>>> dgText or dgData when working with datagrids. dgText will only give you
>> the
>>>> DISPLAYED data in the datagrid as text. The dgData will give you ALL the
>>>> data in the datagrid as an array, INCLUDING the columns that are NOT
>> being
>>>> displayed. Another good argument for using dgData wherever you can.
>>>> 
>>>> Now what we need is an update to the filter command so that it works on
>>>> arrays!
>>>> 
>>>> Bob
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> Pete
>>> Molly's Revenge <http://www.mollysrevenge.com>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at 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 at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
> 
> 
> -- 
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list