(data grid) is there a good workaround for obtaining other column values in FillInData for a Data Grid Table?

Mike Bonner bonnmike at gmail.com
Tue Aug 17 22:52:34 EDT 2010


If you set a custom behavior for the column you want the sum in, and
where it has the section for filling data, put

   put the dgDataOfIndex[ the dgIndex of me] of the dgControl of me
into theDataA
   set the text of field 1 of me to (theDataA["Col 2"] + theDataA["Col 3"])

Should work fine. Not positive this is the best method, but seems to
work dandy fine with small datasets.  Haven't tried it with big ugly
datasets.

On Tue, Aug 17, 2010 at 8:15 PM, Josh Mellicker <josh at dvcreators.net> wrote:
> Let's say you had a data grid table with three columns, and you wanted the first column to be the sum of the other two, like this:
>
> 10      7       3
> 5       2       3
> 7       4       3
>
> How would you calculate the first column while the table is filling in?
>
>
> ---
>
> Originally, we looped through the data and did the calculations, then put the data into the data grid. Now the data set is getting so large that this is too slow, looping through once to calc, then again for the grid. So we're thinking doing the calculation in FillInData would be more efficient. If possible.
>
> It's easy to find any field value in a Data Grid form, since pData is an array with the row values, but we'd like to avoid switching to a form._______________________________________________
> 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
>



More information about the use-livecode mailing list