Further to my recent problems with DataGrid forms :
I've managed to sort my DataGrid by Key with a:
dispatch "sortDataByKey" to group "myDataGrid" with "myKey", "International", "Ascending/Descending", "False"
but... when I then click / select a specific item/row I'm parsed the data from the wrong dgIndex.
If I remove the sort then everything works just dandy... add the sort and my line/row selection goes to pot...
What I'm trying to do is pass all the relevant data on a specific item into a DataGrid but only displaying enough of it to enable the user to select the item they want to see. Clicking on the required line/row should (well, it does when I don't sort the data) open a group of items that displays the item in full... well, that's the idea but, like I say, I can't get it work after a sort...
Any ideas please ?
Problem after datagrid form sort
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Problem after datagrid form sort
Last edited by Traxgeek on Sat Sep 07, 2013 4:40 pm, edited 1 time in total.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Re: Problem after datagrid form sort
Hi Trax,
what did you script "on mouseup" that does not work correctly after a sort?
Be sure to query the current dg INDEX and not LINE, which may of course change after a sort!
Best
Klaus
what did you script "on mouseup" that does not work correctly after a sort?
Be sure to query the current dg INDEX and not LINE, which may of course change after a sort!
Best
Klaus
Re: Problem after datagrid form sort
Hi Klaus,
Before sorting (SortDataByKey), my MouseUp script works as expected. After a sort it fails.
My 'on MouseUp' script looks like :
on MouseUp
local sData
put the dgDataOfLine[the dgindex of me] of me into sData
Display_DetailedDGData sData --pass the complete data subset (for this DG row) to my detailed data display script...
end MouseUp
When I remark out the sort, populate the DG and select a line all works as expected...
Hope you can help.
Have a great weekend.
Before sorting (SortDataByKey), my MouseUp script works as expected. After a sort it fails.
My 'on MouseUp' script looks like :
on MouseUp
local sData
put the dgDataOfLine[the dgindex of me] of me into sData
Display_DetailedDGData sData --pass the complete data subset (for this DG row) to my detailed data display script...
end MouseUp
When I remark out the sort, populate the DG and select a line all works as expected...
Hope you can help.
Have a great weekend.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Re: Problem after datagrid form sort
AHA!
the DGLine <> the DGIndex!
The Index stays "fix" where LINE (the visibke representation of a record) may change e.g. after a sort!
Best
Klaus
the DGLine <> the DGIndex!

Code: Select all
on MouseUp
local sData
## Use this:
put the dgDataOfIndex[the dgindex of me] of me into sData
## OR:
## put the dgDataOfLine[the dgLine of me] of me into sData
## But mixing them will cause some headache!
Display_DetailedDGData sData --pass the complete data subset (for this DG row) to my detailed data display script...
end MouseUp
Best
Klaus
Re: Problem after datagrid form sort
Ahhhhhhh.... thanks a million Klaus !
Must confess, hadn't noted the difference - have now (these datagrids; they're tricky critters !!
Brilliant - much appreciated.
Must confess, hadn't noted the difference - have now (these datagrids; they're tricky critters !!
Brilliant - much appreciated.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1