Added row to data grid is not selectable

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 332
Joined: Sun Apr 15, 2012 1:17 am
Contact:

Added row to data grid is not selectable

Post by Newbie4 » Mon Jul 16, 2012 10:59 pm

I add a new line to a class in my data grid using

Code: Select all

      dispatch "AddLine" to group "Class" with theRowData, theDataColumns, theLineNo
It shows up in my data grid table and I can select it in the table but it can not look it up by the index. (It does not find it)

I added the following line after adding it:

Code: Select all

   dispatch "ResetList" to group "Class"
but it makes no difference. After I change classes and return to that class, my added record is gone.

Am I missing doing something or not resetting the indices?
Last edited by Newbie4 on Tue Jul 17, 2012 1:32 am, edited 1 time in total.
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10321
Joined: Wed May 06, 2009 2:28 pm

Re: Added row to data grid disappears

Post by dunbarx » Mon Jul 16, 2012 11:53 pm

Here is an odd suggestion:

Does your DG have scrollbars? If so, deselect them and then put them back. If not, add a horizontal one and then take it away.

Does the missing line come back?

I had a DG that required this in order to show the last line after a while. I eventually solved the problem by discarding the entire thing and making a new one. Never saw the issue again.

Craig Newman

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 332
Joined: Sun Apr 15, 2012 1:17 am
Contact:

Re: Added row to data grid disappears

Post by Newbie4 » Tue Jul 17, 2012 1:07 am

Thanks for the suggestion but the answer is no, I do not have any scrollbars. The window is large enough that I do not need them.

How do you add them? I will try that just to see what happens..

It looks as if the index isn't updated. I can even change the sort order. It gets placed in the proper sort order depending on which column I select but even if I click on it, it does not get selected by the code below:

Code: Select all

on selectionChanged pIndexes
   global array
   
   put the dgDataOfIndex[pIndexes] of me into theStudentA
   
   uiViewStudent theStudentA["ID"]   
   -- [1] represents the 1st class
   --   put the dgDataOfRow[pRow] 
   --   answer array[1]
end selectionChanged
Is there anything I can do to include the new record in the indexes?
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

Post Reply