SortDataByKey

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
link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

SortDataByKey

Post by link76 » Wed Sep 17, 2014 12:58 pm

Hello,

I would like to filter my DG Form a column text (template row: field "Ospedale") but does not work:

Code: Select all

on MouseUp
dispatch "SortDataByKey" to group "DataGrid_Att_h_fasce" with "Ospedale", "text", "Ascending", "false"
dispatch "RefreshList" to group "DataGrid_Att_h_fasce" 
end MouseUp
thank you

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: SortDataByKey

Post by Klaus » Wed Sep 17, 2014 1:11 pm

link76 wrote:I would like to filter my DG Form a column text (template row: field "Ospedale")
Sorry, don't understand!?
Do you have a column named "Ospedale" in your datagrid?

link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

Re: SortDataByKey

Post by link76 » Thu Sep 18, 2014 7:01 am

Klaus wrote:
link76 wrote:I would like to filter my DG Form a column text (template row: field "Ospedale")
Sorry, don't understand!?
Do you have a column named "Ospedale" in your datagrid?

I have a DG style Form, in row template is a label (column) "Ospedale", I would like to sort the values (Ascending or Descending),

thx

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: SortDataByKey

Post by Klaus » Thu Sep 18, 2014 12:53 pm

Hmm, syntax is correct, sorry no idea so far...

I would however leave out the last line, because the last parameter of SortDataByKey
defines if RefreshList is also applied to the datagrid after sorting :D

Code: Select all

on MouseUp
    dispatch "SortDataByKey" to group "DataGrid_Att_h_fasce" with "Ospedale", "text", "Ascending", "TRUE"
end MouseUp
Best

Klaus

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: SortDataByKey

Post by quailcreek » Thu Aug 27, 2015 10:02 pm

Old thread but same issue. Has anybody gotten this to work on a DG form? I have a DG form that's populated using dgText so I can filter it later.

"More" is the name of the fld in the DG row template. Nothing seems to work.

Code: Select all

dispatch “SortDataByKey” to grp "PracticeList_DG" with "More", "international", "descending", "false"

on FillInData pDataArray
   set the text of fld "Name" of me to  pDataArray["Name"]
   set the text of fld "More" of me to  pDataArray["PreformanceLevel"] 
end FillInData
Tom
MacBook Pro OS Mojave 10.14

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: SortDataByKey

Post by sritcp » Fri Aug 28, 2015 2:32 am

On LC 6.7.6, the following code

Code: Select all

dispatch "SortDataByKey" to group "DgForm1" with "Field1", "text", "descending", "false"
works perfectly for me.

Something to do with LC7?

Regards,
Sri

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: SortDataByKey

Post by quailcreek » Fri Aug 28, 2015 4:03 am

I figured it out. I have thumb nail images in the DG. This, for some reason, stops the sort from happening. I submitted a bug report. Thanks for the reply. For now I'll remove the images.
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: SortDataByKey

Post by quailcreek » Fri Aug 28, 2015 4:38 am

OOpps. I found the problem. I copied the SortDataByKey from someplace. To lazy to type. :oops: and I ended up with curly quotes. Mybad.
Tom
MacBook Pro OS Mojave 10.14

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: SortDataByKey

Post by bn » Mon Aug 31, 2015 12:07 pm

Hi Tom,

I've looked at
Bug 15802
that you reported. I have also seen your comment that it is not a bug.

The status is "confirmed"

You as the author can change the status to "Not a bug"

That way it reduces unnecessary open tickets in Quality Control Center. It would be a nice gesture and save QCC some time.

Kind regards
Bernd

Edit: when you open a bug report and refer to it it would be nice to also put the bug number. Thank you.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: SortDataByKey

Post by bn » Mon Aug 31, 2015 11:42 pm

Hi Tom,

thanks for setting Bug 15802 to "Not a Bug"

Kind regards
Bernd

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: SortDataByKey

Post by quailcreek » Mon Aug 31, 2015 11:44 pm

No worries.
Tom
MacBook Pro OS Mojave 10.14

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: SortDataByKey

Post by quailcreek » Thu Sep 03, 2015 10:41 pm

I got the sort, sorted out. :) But I have another question. When I sort on a key (ascending) where some of the entries are empty, the empty ones are at the top. Is there a way to sort ascending and have the empty values at the bottom?
Tom
MacBook Pro OS Mojave 10.14

Post Reply