Debugging DataGrid script
mfstuart
mfstuart at cox.net
Tue Jun 23 11:47:05 EDT 2009
Hi George,
I think I wasn't clear on whether I had headers defined or not. But was
going by what Trevor had defined on his site as the way to use the script to
populate a DG.
Anyway, I have a header already defined with 4 columns.
>From Trevor's previous reply, it seems that using a script to populate a DG
with "set dgText..." NOT on the card where the DG is, will not populate the
DG, at this point.
And I have 9 cards with a DG on each card that I want to populate, all from
the result of the same script, not on any of these cards.
I may have to come up with a work around from the results of this
restriction.
Work around question:
Trevor, if I populate all 9 sets of data into 1 DG and define an extra
column called "Type", that defines the type of record, then this may work.
But then I need to allow the user to filter the records from one type of
record set to another, and back again.
I checked out your website for "filter" and didn't see any reference.
How do I filter the records in a DG?
All records in the DG have been populated from reading a txt file.
So there's no database integration in this, as yet. But would be added if
needed to filter correctly.
I would use an Option Menu as the filter, to list the 10 Types of records.
(The first selection is blank for all records when selected)
So when the user selects an option, the DG would filter on the "Type"
column, equal to the selected option. If first option in the list is
selected, then display all records.
And then changing the selection would filter again the records in the DG.
I'm not sure how to filter records subsequent times, if they have already
been filtered when the original contents of the DG were not from a DB.
Regards,
Mark Stuart
George C Brackett wrote:
>
> This may not help (I can't remember if you had headers or not), but I
> got stuck with the same code, copied from the PDF docs). My datagrid
> stayed blank until I noticed the following, printed shortly after the
> code:
>
> "Note that if pFirstLineContainsHeaders is true then the columns must
> already exist in your data grid
> table in order to be displayed."
>
> George
>
> On Jun 22, 2009, at 10:27 PM, Trevor DeVore wrote:
>
> On Jun 22, 2009, at 8:14 PM, mfstuart wrote:
>
>> I originally got that script line from Trevor's web site.
>> I tried it with the [] brackets, both with space and no space.
>> I tried it without the [] bracket value.
>> All 3 ways the script stops running at this line, with no returned
>> error.
>
> Your syntax is fine. Spaces around brackets won't affect the parsing
> and since firstLineContainsHeaders is a variable it shouldn't have
> quotes around it.
>
>> Trevor, anyway to find out what's going on setting a DataGrid NOT
>> from the
>> place where the DG object is and this error?
>
> A data grid table won't work so well if you try to work with it on
> cards that aren't open. The data grid table tries to access the
> formattedHeight property of fields when working with the header. This
> property always always return 0 if the card isn't open.
>
> In addition if you dig around in the code you would find that some
> control references are stored with the card/stack references stripped.
> This is probably causing the immediate error. It is easy enough to
> update the data grid to resolve the cached control references but I'm
> not sure about addressing the formattedHeight issue. I will have to
> investigate.
>
> Regards,
>
> --
> Trevor DeVore
> Blue Mango Learning Systems
> www.bluemangolearning.com - www.screensteps.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
--
View this message in context: http://www.nabble.com/Debugging-DataGrid-script-tp24155940p24167344.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list