tag:blogger.com,1999:blog-297145524620104573.comments2021-02-15T18:51:05.433+01:00Tudor's SharePoint BlogTudorhttp://www.blogger.com/profile/04887878575330768814noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-297145524620104573.post-59034357119992283462010-01-16T22:25:09.067+01:002010-01-16T22:25:09.067+01:00Thank you. This was very helpful.
Bazin Makonnen...Thank you. This was very helpful. <br /><br />Bazin MakonnenBazin Makonnennoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-70575249189051893462009-06-05T17:59:44.788+02:002009-06-05T17:59:44.788+02:00Thanks Tudor. jqueryui.com is up again today and ...Thanks Tudor. jqueryui.com is up again today and my script is working again, but I'll ask our IT team to install it locally.<br />ScottAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-39923795948400041862009-06-05T08:49:29.143+02:002009-06-05T08:49:29.143+02:00Hi Scott,
Yes, it seems that jqueryui.com is down...Hi Scott,<br /><br />Yes, it seems that jqueryui.com is down. You could download the files from <a href="http://code.google.com/p/jquery-ui/" rel="nofollow">here</a> and reference them locally to avoid relying on jqueryui.com, or you could reference the js file directly from googlecode, as there can be a pretty good chance the browse has already cached the script from a previous page request.Tudorhttps://www.blogger.com/profile/04887878575330768814noreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-13891270009491619762009-06-05T02:48:20.173+02:002009-06-05T02:48:20.173+02:00Tudor, me again (Anonymous from 25 April, but actu...Tudor, me again (Anonymous from 25 April, but actually Scott). The function suddenly stopped working today. I am using it as written, accessing http://jqueryui.com/latest/jquery-1.2.3.js. If I can't navigate my browser to that link (website unavailable), could that be the problem?<br />ScottAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-5451352464271238652009-04-25T01:38:00.000+02:002009-04-25T01:38:00.000+02:00That worked perfectly. Thank you very much!That worked perfectly. Thank you very much!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-59844248768330311422009-04-24T23:03:00.000+02:002009-04-24T23:03:00.000+02:00The code should be added as a javascript code insi...The code should be added as a javascript code inside the page. Therefore, you could add another content editor webpart, edit it's html source (the second button, just below the one you use to edit it's content) and embed the code above like this:<br /><br /><br /><br /><script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script><br /><br /><script type="text/javascript"><br />//insert the code here<br /></script><br /><br /><br /><br />The first <script> tag is a reference to the jquery source code, while the second one contains our code. The content editor webpart holding the code above will be invisibile because it doesn't output anything visible in the browser.<br /><br />You could also download a copy of the jquery script from jquery.com and store it locally, to avoid accessing external resources.<br /><br /><br />Hope it helps!<br />TudorTudorhttps://www.blogger.com/profile/04887878575330768814noreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-66424493618606084132009-04-24T20:42:00.000+02:002009-04-24T20:42:00.000+02:00This is exactly what I am looking for to restore a...This is exactly what I am looking for to restore and minimize a content editor web part. But where do I put that code? (I'm a power user, not a developer.)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-27495049898533813452009-01-25T13:44:00.000+01:002009-01-25T13:44:00.000+01:00Hi Daniel,Sorry for the late reply.You just need t...Hi Daniel,<BR/><BR/>Sorry for the late reply.<BR/>You just need to add a data-type attribute to your sorting expression, like this:<BR/><BR/> <xsl:sort select="count(//Row[@Country=current()/@Country])" order="descending" data-type="number" /><BR/> <xsl:sort select="count(//Row[@Company=current()/@Company])" order="descending" data-type="number" /><BR/><BR/><BR/>I have updated the article accordingly, thank you for pointing out this omission.<BR/> <BR/>TudorTudorhttps://www.blogger.com/profile/04887878575330768814noreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-3755744665412073362009-01-16T11:41:00.000+01:002009-01-16T11:41:00.000+01:00Hi thanks for a great article, however i have a sm...Hi thanks for a great article, however i have a small problem.<BR/><BR/>When im doing the sorting and the ammount of items is more than two digits (e.g 23 items) the sorting is not sorted as number but as string resulting in the following order.<BR/><BR/>1<BR/>10<BR/>2<BR/>3<BR/><BR/>I have tried using format-number before the sorting expression without any luck. Do you have any other suggestions?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-70543929092423431432008-11-01T23:27:00.000+01:002008-11-01T23:27:00.000+01:00Renee,I understand what you need to do, it seems s...Renee,<BR/><BR/>I understand what you need to do, it seems something quite usual and therefore I have posted a new article about the solution to your problem, you can find it <A HREF="http://tudorolariu.blogspot.com/2008/11/custom-group-order-in-sharepoint-list.html" REL="nofollow">here</A>.<BR/><BR/>Please let me know if you have further questions regarding this :)<BR/><BR/>TudorTudorhttps://www.blogger.com/profile/04887878575330768814noreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-18253210088718874032008-10-31T04:01:00.000+01:002008-10-31T04:01:00.000+01:00Wonderful - that worked! One small quirk because ...Wonderful - that worked! One small quirk because I have 1 more group heading before my Company heading. Let's say it is called Country, where I'm grouping all companies by Country in ascending order. I believe this may affect where I place the new xsl:sort code, or maybe even change that code completely. Because after adding the code you provided, I am seeing more than 1 of the same country group header with company's below it. Must be based somehow on the count value of the child for Company??<BR/><BR/>Thank you for your response and I hope you can understand this new comment - I'm not sure I do!! :)<BR/><BR/>Thanks<BR/>ReneeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-36432868574762182752008-10-30T15:50:00.000+01:002008-10-30T15:50:00.000+01:00Hello,Concerning your problem to sort the groups a...Hello,<BR/><BR/><BR/>Concerning your problem to sort the groups acording to the number of elements they contain, I will assume the following about your list:<BR/><BR/>-The elements are grouped by a column called <B>Company</B> (which can be a look-up field or a choice, it doesn't matter)<BR/><BR/><BR/>1. Open your page in SharePoint Designer and convert your list to an XSLT DataView.<BR/>2. In code view, inside the generated xslt, locate the definition of the template called <B>dvt_1.body</B>. You will see that it contains the name of some template parameters (ParentPath, Rows, FirstRow, LastRow), the definition of the $dvt_Rows variable, and then the iterating through $Rows starts. Right after the xsl:for-each tag, you should add the following line:<BR/><BR/><xsl:sort select="count(msxsl:node-set($dvt_Rows)/root//Row[@Company=current()/@Company])" order="descending" /><BR/><BR/><BR/>You can change @Company to whatever your grouping column is called.<BR/>Basically, it sorts the current group headers by the number of child rows which have the same value in the Company attribute as your current group section row has, which is exactly what you are looking for.<BR/>For more insight, check how $dvt_Rows is defined.<BR/><BR/><BR/>As you can see, after converting the previously grouped list to an XSLT Data view, the number of child rows for each group isn't displayed anymore. To show it again, locate the definition of the dvt_1.groupheader0 template, scroll just before it ends, locate the line:<BR/><BR/><xsl:otherwise><xsl:value-of select="$fieldvalue"></xsl:value-of></xsl:otherwise><BR/><BR/><xsl:otherwise><xsl:value-of select="$fieldvalue"></xsl:value-of> (<xsl:value-of select="count($nodeset)" />) </xsl:otherwise><BR/><BR/>The count($nodeset) displays the number of "child" rows contained by this group.<BR/><BR/>Also, on a minor note, the template names above (such as dvt_1.groupheader0) are the defaults created by SharePoint Designer when there are no other such data views in the page. Depending on this, the name templates may change.<BR/><BR/><BR/>Thank you for your interest in this,<BR/><BR/>TudorTudorhttps://www.blogger.com/profile/04887878575330768814noreply@blogger.comtag:blogger.com,1999:blog-297145524620104573.post-45137580717356908282008-10-30T05:18:00.000+01:002008-10-30T05:18:00.000+01:00Hello, thank you for your post - I would like to k...Hello, thank you for your post - I would like to konw how you would customize your group order by using the Count of the group. so that the group is ordered descending by the number of items in the group? <BR/><BR/>So that if you Group by Company Name, you get the following as group headers?<BR/><BR/>Company Name C(5)<BR/>Company Name A(3)<BR/>Company Name B(1)<BR/><BR/>Thank you!Anonymousnoreply@blogger.com