Page 1 of 1
DataGrid and Disappearing Column Labels
Posted: Sun Jun 17, 2012 10:50 pm
by rrBUSS9EE
I started to see this in my stack a few days ago. Now it is happening a lot.
Anyone know the cause for this and how to refresh them. Obviously clicking the "Refresh Data Grid" button in the property inspector brings them back, but that is not going to be an option in the finished app.
P.S. Sorry for the double post as I original put this in "Mac OS" as that is what I am developing on, but thought more folks would notice it here. Mods… feel free to delete the other one.
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 4:50 am
by dunbarx
I don't think there is an explicit "refresh" command, but you can refresh a dataGrid under script control in a few ways. For example,
set the dgDataOfIndex[the dgHilitedIndex of group "yourDataGrid" ] of group "yourDataGrid" to someNewData --someNewData could be just the original row array.
This begs the issue of why the labels are hiding. I found a similar sort of issue in a project, where the first row would disappear now and then, as if I scrolled down one line. I had no scrollbars at all. Refreshing fixed this, though I ultimately made the glitch go away by including the horizontal scrollbar and accepting a slightly taller DG object.
So there are peculiarities with dataGrids, however cool and powerful they are. You have to indulge them. But it might be worrisome if others have to depend on them. This makes their use in a standalone dicey, I think, unless these kluge fixes are rock solid.
Craig Newman
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 2:57 pm
by rrBUSS9EE
Thanks… but I could never label anything "cool and powerful" that does not work. These are very simple (almost default) Datagrids populated via dgText from a simple SQLite database. Resetting the dgText does nothing to help redraw the missing column labels.
Odd that the DG I am having the most problems with has both H and V scrollbars (the others only V).
I am curious what the refresh button in the Prop Inspector is doing, and if I could do that by script.
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 3:26 pm
by Klaus
Hi rrBUSS9EE,
column labels do not disappear out of a sudden!
Once set, they will stay unless deleted or set anew via script.
I guess you are using something like:
...
put true into firstLineContainsColumnNames
set the dgText[firstLineContainsColumnNames] of group "DataGrid" to tYourDatabaseResultsHere
...
If you do please make sure that the column labels are really always present and complete!
Best
Klaus
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 3:56 pm
by rrBUSS9EE
Hi Klaus,
No. My data has no column names so I am just using:
set the dgText of group <groupname> to myData
My data is tab/return delimited as returned from an SQLite table with revDataFromQuery. The column labels are set up in the PI and do not change. When they "disappear" from the grids, they are still intact in the PI, and touching Column Label field by opening it and then hitting the enter key refreshes that column. The Refresh Data Grid button refreshes them all.
These grids are initially populated on preOpenStack, and in other places/times in the stack when changes to the database are made. The labels disappear in a seemingly random pattern when the dgText of the various grids is reset.
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 4:17 pm
by Klaus
Hi rrBUSS9EE,
hm, ok, just wanted to be sure
You can "refresh" the datagrid via script like this:
...
dispatch "ResetList" to group "Your datagrid here"
...
Best
Klaus
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 4:44 pm
by rrBUSS9EE
Thanks Klaus!
Popping that into an openCard handler seems to have done the trick.
Re: DataGrid and Disappearing Column Labels
Posted: Mon Jun 18, 2012 4:50 pm
by Klaus
Cool!
