Page 1 of 1
Datagrid problem [SOLVED]
Posted: Fri Feb 14, 2014 11:00 am
by MaxV
Hi,
I have a problem with my datagrid, look at the following picture (click on it to see all the picture):
As you can see, the second column appear empty, but I correctly filled it. Looking in the property window I see that there are the values in the second column.
I used
dgText or
dgData property to fill the table, in both cases I obtain the second column empty. It' s stange since Livecode says that there are values in that column.
The datagrid in this particular case has 38'873 rows and 9 columns.
What do you think? Where is the problem?
Re: Datagrid problem
Posted: Fri Feb 14, 2014 1:39 pm
by bangkok
Show us your code with DgText (the easiest way, dgData with arrays is more tricky).
Re: Datagrid problem
Posted: Fri Feb 14, 2014 2:27 pm
by dunbarx
Hi.
What Bankok said. But real quick, what does this show in the group script:
Code: Select all
on mouseup
get the dgText of me
set the itemdel to tab
answer item 2 of it
end mouseup
Click somewhere in the DG. What do you see?
Craig
Re: Datagrid problem
Posted: Fri Feb 14, 2014 3:54 pm
by MaxV
The result of:
Code: Select all
get the dgText of group "tabellona"
set the itemdel to tab
answer item 2 of it
is
and it's right.
The result of
Code: Select all
put the dgText of group "tabellona"
is
Code: Select all
1 1 Come si chiamano i grandi rotoli di carta utilizzati nelle rotative da stampa? 1 Rotoloni Bobine Stelloni
2 4 Come si chiama la piattaforma tripartita sulla quale poggiavano le colonne dei templi greci? 2 Stilobate Agorà Crepidoma
3 2 Come si traduce in latino la parola 'uccello'? 3 Uccellus Volatilis Luscinia
4 1 Come si chiamava il dio romano del mare? 4 Tritone Nettuno Poseidone
5 1 In quale racconto mitologico viene ampiamente narrato l'episodio del cavallo di Troia? 5 Iliade Eneide Troiade
6 5 In Italia è conosciuto col nome latinizzato di Cartesio. Ma come si chiama in realtà il famoso filosofo, scienziato e matematico francese? 6 Renè Cartes Renè Descartes Renè Cartesiou
... (snip)...
38872 1 La 'Grande Muraglia' una delle sette meraviglie del mondo, passa nei pressi di quale fra queste città? 38872 Mosca Berlino Pechino
38873 7 Come si chiama la disciplina che descrive e classifica le diverse varietà dei vitigni? 38873 Ampelografia Barrique Remuage
If you
open and look carefully at the image, on the left there is the data grid and on the right the DgText. So why on
Property/Content I can see the column data and on the datagrid not?
Re: Datagrid problem
Posted: Fri Feb 14, 2014 6:07 pm
by bangkok
Have you checked the visible property of the second column ?
Otherwise : try to create a new DG.
Re: Datagrid problem
Posted: Mon Feb 17, 2014 11:29 pm
by Zryip TheSlug
Hi MaxV,
What are the columns name of your DataGrid and how are you populating it?
Best,
Re: Datagrid problem
Posted: Wed Feb 19, 2014 3:34 pm
by MaxV
Hi Zryip,
the column name is "livello" and I tried two method using
dgText and
dgData, you can test the script on:
http://livecodeshare.runrev.com/stack/7 ... administer
It's a strange bug...
Re: Datagrid problem
Posted: Wed Feb 19, 2014 8:56 pm
by Zryip TheSlug
Hi MaxV,
I explored the datagrid template of your datagrid.
For columns "Livello" and "Domanda" you have a custom template. You have probably clicked on the + button at the right of the "column behavior" button in the "columns" tab of the inspector.
When a column has a custom behavior, the datagrid engine adds 2 items in the datagrid template:
- a group named with the column name. This group contains a "_columndata_" field
- a button named with the column name + "behavior"
For columns without custom behaviors, the datagrid engine uses a standard script located in the datagrid library. For columns linked to a custom behavior the datagrid is using the column button behavior located in the datagrid template.
For example for column "Livello" you should have:
- a group "livello"
- a button "livello behavior"
In your case the button "livello behavior" is missing (card id 1005 in your datagrid template substack) . That is the reason this column remains empty and do not react to double click.
Deleting the column will not solve the problem, because the inspector is not deleting the column group in the datagrid template. So when you will recreate the column with the same name, it will be linked again to the missing custom behavior.
Assuming you are not a Data Grid Helper user, for fixing the issue:
- 1. Double-click on the datagrid group to open the inspector
2. In the "Basic properties" tab, click on the "Row template" button
3. In the template card, select the group, then edit it
4. Select the "Livello" group (it has not name and should be located at the left of the "domanda" group
5. Delete the "Livello" group
6. Save the template card and close it
7. The link to the column custom behavior should be removed, and your "livello" column behaving as expected.
In case a DGH user would read this message and would be confronted to a similar problem with a datagrid:
- 1. Select the column in the DGH column builder
2. delete it.
3. Confirm the dialog warning about the presence of custom behavior for the column. DGH will delete the column and the corresponding controls in the datagrid template.
4. Recreate the column
Best,
Re: Datagrid problem [SOLVED]
Posted: Fri Feb 21, 2014 12:00 pm
by MaxV
WOW, you are a datagrid master! You solved it!
Thank you!
