<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Jackie,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hey, thanks, I think I am making progress.&nbsp; I am imagining that SORT_PROPERTY is supposed to be the field name of the passed data, but that does not work.&nbsp; Can you clarify what I am supposed to use here, and if it is the field name how I can get determine what it is?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Jackie Ng [via OSGeo.org] [mailto:<a href="/user/SendEmail.jtp?type=node&node=4362835&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>] <br><b>Sent:</b> Tuesday, January 31, 2012 8:21 AM<br><b>To:</b> Oudemans, Sierk<br><b>Subject:</b> RE: How to sort a selection set<o:p></o:p></span></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>The sorting function need not be that complicated. <br><br>Something like this will suffice: <br><br>results.sort(function(objA, objB) { <br>&nbsp; &nbsp;if (objA.SORT_PROPERTY &lt; objB.SORT_PROPERTY) { <br>&nbsp; &nbsp; &nbsp; &nbsp;return -1; //Less than <br>&nbsp; &nbsp;} else if (objA.SORT_PROPERTY &gt; objB.SORT_PROPERTY) { <br>&nbsp; &nbsp; &nbsp; &nbsp;return 1; //Greater than <br>&nbsp; &nbsp;} else { <br>&nbsp; &nbsp; &nbsp; &nbsp;return 0; //Equal <br>&nbsp; &nbsp;} <br>}); <br><br>Where SORT_PROPERTY is the name of the property of the object you want to sort on. <br><br>- Jackie <o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><hr size=1 width="100%" noshade style='color:#CCCCCC' align=center></div><div><div><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";color:#444444'>If you reply to this email, your message will be added to the discussion below:<o:p></o:p></span></b></p></div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";color:#444444'><a href="" target="_top" rel="nofollow" link="external">click here</a>.<br><a href="http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" target="_top" rel="nofollow" link="external"><span style='font-size:7.0pt;font-family:"Times New Roman","serif"'>NAML</span></a> <o:p></o:p></span></p></div></div>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/How-to-sort-a-selection-set-tp4344383p4362835.html">RE: How to sort a selection set</a><br/>
Sent from the <a href="http://osgeo-org.1560.n6.nabble.com/MapGuide-Users-f4182607.html">MapGuide Users mailing list archive</a> at Nabble.com.<br/>