Going crazy with dgText

zryip theSlug zryip.theslug at gmail.com
Sun Nov 14 17:11:20 EST 2010


On Sun, Nov 14, 2010 at 9:53 PM, Éric Miclo <eric.miclo at wanadoo.fr> wrote:
> Hello,
>
> I've a little script that populates a dataGrid with a tab delimited text (titles are located in the first line).
> In the IDE everything works fine but once the application is built the dataGrid is always empty.
> I've tried everything I could think of but didn't get it.
>
> Here is the script (located in the preOpenStack handler of a one card stack):
>
>  if the cParamétrageDesItems of this stack is not empty then
>    set the dgData of group "Paramétrage items" to empty
>    dispatch "ResetList" to group "Paramétrage items"
>    put the cParamétrageDesItems of this stack into itemListWithTitle
>    set the dgText ["true"] of group "Paramétrage items" to itemListWithTitle
>    dispatch "ResetList" to group "Paramétrage items"
>    set the cParamétrageDesItems of this stack to empty
>  end if
>
> If someone has an idea why it doesn't work once built I'd be very happy.

Hi Éric,

Assuming the cParamétrageDesItems property is not empty and the
datagrid library is included:

1) First, try to remove the lines -> dispatch "ResetList" to group
"Paramétrage items"
The resetList command is useful if you have to reset a dg after a
change in a template. The refresh of the data is took in care when you
set new datas with the dgText or dgData properties.
However in some case, when the indexes are not properly set, reset the
datagrid with a resetList could result of an empty dg.
If the indexes are empty, the problem could be the preOpenControl of
the datagrid was not executed.
You can check the indexes by using the dgIndexes property of a datagrid.

2) Try to populate the dg with the pFirstLineContainsHeaders parameter
set to false. When set to true the data will be mapped by matching the
names of the column in the datagrid and the first line of the data.
If by setting the pFirstLineContainsHeaders to false, you get data,
this could be a problem in the columns names.


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



More information about the use-livecode mailing list