[ 4 posts ]

Chandu

  • Username: newbie120
  • Joined: Tue Mar 20, 2012 5:57 am
  • Posts: 2
  • Offline
  • Profile

Sorting Hyphenated Names in a Column

Post Posted: Tue Mar 20, 2012 6:19 am
+0-
newbie started using YUI API to write some small programs. While doing some stuff related to
Sorting a column with names

here is data table declaration for name field

{key:"fullName", label:"Name", sortable:true, className: 'col1'},

names like {"adam", "will", "john", "jessica"} are getting sorted

but when i add {"adam", "will-smith", "john", "jessica"}

hyphenated name will-smith i see the sorted column with "will-smith" always first then followed by alpahbetical sorting order.

any suggestion how to go about to sort hyphenated names with regular names.

Thanks,
chandu

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Sorting Hyphenated Names in a Column

Post Posted: Tue Mar 20, 2012 10:21 am
+0-
might it be because the html tag for boldface which starts with a less-than symbol which precedes all lowercase characters? Datatable uses JavaScript's own Array sort function so it will sort just as JavaScript would do natively.

Chandu

  • Username: newbie120
  • Joined: Tue Mar 20, 2012 5:57 am
  • Posts: 2
  • Offline
  • Profile

Re: Sorting Hyphenated Names in a Column

Post Posted: Tue Mar 20, 2012 11:00 am
+0-
used Bold only to indicate that having problem sorting hyphentaed names

like "will-smith" , "rob-joy" when they are mixed with regular names without hyphen

like "bob" "alice" etc.

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Sorting Hyphenated Names in a Column

Post Posted: Tue Mar 20, 2012 12:26 pm
+0-
I thought so, but since I couldn't find any other reason for that strange behavior, I wondered if it might be this.
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum