Use of dgIndex

zryip theSlug zryip.theslug at gmail.com
Tue Nov 8 13:36:59 EST 2011


On Tue, Nov 8, 2011 at 2:15 PM, Michael Doub <mike at doub.com> wrote:
> This is driving me crazy.    I  modified my real project code as well as my test stack to use the following:
>
>   put the dgIndex of me into tindex
>   put the dgIndexes of theGrid into tlist
>   set itemdel to comma
>   put itemOffset(tindex,tlist) into myPosition
>
> The test stack works fine, but in my project code dgIndex is not retuning anything!    I captured the value of me in both the test stack and my project.  I get different values of me!
>
> test stack returns  group "Row Template 0001"  (number part seems to be = to dgLine and it increments)
>
> my project stack returns  group "Row Template"

Add a button in your project with this script:

put the behavior of the dgProps["row template"] of grp "myDatagrid"

where myDatagrid is the name of your datagrid.

What is the result in the message box?

> Does anyone know if there are any interactions between the debugger and data grids?   I wonder if I have messed up some internal state of the data grid while debugging.

The datagrid is a complex group using simple Livecode controls and
custom properties. There is no specific interaction while debugging.

>
> My project code is managing 2 different sortings of the data.  The different sortings are being directed to the data grid by calling
>
> Dispatch "SortDataByKey"  to group "DataGrid" of card Main with \
>         "LastName","text","ascending",true
>   get the sortOrder of Card "Main"
>
> and
>
>  Dispatch "SortDataByKey"  to group "DataGrid" of card Main with \
>            "DaysTill","numeric","ascending",true
>
> from the open stack hander.
>
> I can't believe that sorting is causing this but I am at a loss at this point …. And I have a sinking feeling that SortDataByKey is not a stable sort if it is called multiple times.   Does anyone know for sure?

Sorting a datagrid with the "SortDataByKey" works pretty well. The
only problem I got is with carriage returns in the data sorted.
However that was fixed months ago.


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.com




More information about the use-livecode mailing list