<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Sort a repeating table in 'Asset tracking sample'</title><link>https://www.infopathdev.com:443/forums/thread/14799.aspx</link><pubDate>Thu, 21 Sep 2006 07:24:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14799</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14799.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14799</wfw:commentRss><description>Hi Karsten,&lt;br /&gt;Greg wrote this code ~6 years ago and I reviewed it while still at MS. Search for the sort function. It takes compareAssets as a function argument and passes two items from the index. Hopefully, that's enough info, but if not, I'm sure Greg will respond with more details soon... :)</description></item><item><title>Sort a repeating table in 'Asset tracking sample'</title><link>https://www.infopathdev.com:443/forums/thread/12949.aspx</link><pubDate>Wed, 20 Sep 2006 09:44:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12949</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12949.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12949</wfw:commentRss><description>Hello,&lt;br /&gt;&lt;br /&gt;I have looked at the example in the out-of-box solution for Asset Tracking (Asset tracking form.XSN) and I really would like to use the approach of dynamically sorting a repeated table.&lt;br /&gt;I have tried to get it working half the night but I failed by now ;-((&lt;br /&gt;&lt;br /&gt;Now I hope that someone can explain me the use of the code. My problem is the function 'compareAssets' in the following code:&lt;br /&gt;&lt;br /&gt;I don´t know where I can define the parameters of the function --- in this case xmlAssetLeft and xmlAssetRight&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function compareAssets(&lt;font color="red"&gt;xmlAssetLeft, xmlAssetRight&lt;/font id="red"&gt;)&lt;br /&gt;{&lt;br /&gt;	var xmlLeft = &lt;font color="red"&gt;xmlAssetLeft&lt;/font id="red"&gt;.selectSingleNode(g_xpathSortBy);&lt;br /&gt;	var xmlRight = &lt;font color="red"&gt;xmlAssetRight&lt;/font id="red"&gt;.selectSingleNode(g_xpathSortBy);&lt;br /&gt;	&lt;br /&gt;	var valueLeft  = getValue(xmlLeft);&lt;br /&gt;	var valueRight = getValue(xmlRight);&lt;br /&gt;&lt;br /&gt;	if ((valueLeft &amp;lt; valueRight) || (typeof(valueLeft) == "number" &amp;&amp; typeof(valueRight) == "string"))&lt;br /&gt;		return -1;&lt;br /&gt;	else if ((valueLeft &amp;gt; valueRight) || (typeof(valueLeft) == "string" &amp;&amp; typeof(valueRight) == "number"))&lt;br /&gt;		return 1;&lt;br /&gt;	else&lt;br /&gt;		return 0;&lt;br /&gt;}&lt;/pre&gt;I have searched the whole script code for xmlAssetLeft and xmlAssetRight but the only place where they are used are in this function. &lt;br /&gt;&lt;br /&gt;Does anyone know this sample in detail and can help me to understand this.&lt;br /&gt;&lt;br /&gt;Thank you very much in advance</description></item></channel></rss>