Possible solution for datagrid library errors

Pete pete at mollysrevenge.com
Wed Nov 30 15:26:39 EST 2011


I've noticed a couple of posts recently related to changing the whole
structure of a datagrid based on the type of data being displayed and I
can't help feeling that's asking for trouble at some point (as Bob already
discovered).

I'd like to throw out a couple of suggestions to handle this situation
which I've implemented successfully.

One way is to include columns for all the different data types and
show/hide the columns depending on the data type.  Extending that further,
include as many datagrids on your card as you have data types and hide/show
them as appropriate to the current data type.

Whether either of those will work for you or not depends on the number of
different data types and data items you want to handle but I think they do
run less risk of datagrid errors showing up.

Pete



On Wed, Nov 30, 2011 at 11:51 AM, Bob Sneidar <bobs at twft.com> wrote:

> Hi all.
>
> Some people complained before about errors cropping up in the datagrid
> library. I have found a way to generate an error every time, and it may be
> related to the errors other people are getting.
>
> I have a datagrid that I use for different table data depending on where I
> am at. When I initialize that datagrid, I set the columns, the column
> labels and the column widths. But here's the gotcha. If the datagrid
> already contains data from a previous operation, and I set the columns
> using dgProp["columns"] then I will throw an error every time, I presume
> because the existing array does not contain keys for the columns I am
> setting. I think I can assume this will also be a problem when setting
> other dgProps that are content dependent.
>
> So the cure for me was to make sure I clear the data from my datagrid
> before setting any props using dgProp.
>
> 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>



More information about the use-livecode mailing list