Reordering/Ranking SharePoint List Items
SharePoint link list has a feature which lets you Re-Order list items and this is done using List Actions.
This in turn uses ReOrder.aspx page to reorder list items. Here is a summary how this functionality it implemented.
- Links list contains a field called “Order” which is an internal field and default view is sorted by it.
- Reorder.aspx uses this Order field to update and reorder list items in that view.
- Default view is sorted by Order field and reflects the new order.
Now code that runs in Reorder page doesn’t really care about most list types and location since it uses list GUID to modify the order and the Order field is part of each and every list template but for some reason SharePoint has blocked this feature from all the other list templates, like most other things. But given the list GUID Reorder page is able to sort list items. So why doesn’t it work ? Because Order field being an Internal field is also hidden from other list templates, so while it is possible to reorder we are unable to create a view which will use this order to sort list items.
There are tons of posts around this method and dropping in data view web part to sort list items and solutions which implement their own ordering feature. I prefer a much simpler approach (according to me at least) . Unhide the damn order field and create a view.
I have created a feature which does exactly that.
“List Order” is feature which enables list re ordering for your custom list. The feature is enabled on “Web” level and enables this action item for all the lists for that particular site. The feature has 2 parts to it:
1. Custom List Action item: This provides the action item to link to list –reorder page.
2. “By Order” View: When feature is activated, it creates a view on the supported list called “By Order” which is sorted by the “Order” field. (Note: This is only applies to existing lists and wont reflect on newly created list. however you can create your own views and select the sort by “order” field)
Now the feature once activates will provide the Action Item and View to all the supported list types for that particular site. I haven’t tested this feature with huge list or many other scenarios, but I assume it would work similarly to a link list and I don’t see a use case for manually reordering lists with more than 50 items in it.
Screenshots:
1. Reorder Action item on custom list:
2. “By Order” view before reordering of list items
3. Reorder page
4. “Order By” view after refresh
Note: It is currently configured to work with following list templates:
- Generic List
- Contacts List
- Task List
- Gantt List
You can change them if you like from the source code.
Downloads:
| Feature WSP | Download |
| Source code | Download |
How are you suggesting to add this feature. Using the “stsadm -o addsolution” etc method worked for adding the solution, but deploying it failed claiming “operation or method not supported.” I have deployed custom solutions built in VS 2010 to this very Sharepoint instance, so I know it “can” work…
try stsadm.exe” -o deploysolution -name ListOrder.wsp -local -allowgacdeployment
I still get the following: “The method or operation is not implemented.”
I have updated the solution file. Please download and reinstall it and let me know
Fixed. Thanks much.
I have it deployed with no problem. Why is it only available for a custom list and not the “Service Request” list (that comes with the IT Team Workspace template)?
Thanks
This feature does not work with document libraries and since there is no easy way to enable this feature on all lists I have configured it to work with following list templates:
Generic List
Contacts List
Task List
Gantt List
but you can download the source the source code and add your list template type and redeploy it.
Hi,
Is there any workaround to implement this feature for Doc libs? I can able to attach this feature to the doc template (101) but the order column is not updating.
Thanks in advance,
JP
You are right it does not work for document libraries.
Hi
I am not a sharepoint expert and would appreciatehave some assistance with this please.
I have installed the wsp using the following commands:
“stsadm -o addsolution -filename (path to file)”
“stsadm -o deploysolution -name ListOrder.wsp -local -allowgacdeployment”
Both commands completed successfully but the “ReorderList” Action item does not appear on any of my current lists (task lists / Generic lists) and is not available on new lists. I have also tried creating a new view but the “order” field is not available. I guess this is something that i have not done correctly, have i missed something out?
Thanks in advance
Did you activate the feature for the website?
Aha!!
I hadn’t had to activate a feature before (i told you i was no expert) your assistance was much appreciated.
Thanks for your all your hard work, this feature will help me no end
Do you have any advice on how to convert this to .dwp for 2010?
Thank you.
Has anyone tried rebuilding this solution with VS2010? I tried, but am having some difficulty with the Sharpoint Packaging tool to get the .wsp built. The source solution as provided, opens as a standard C# solution. However, in order to get the packaging tool, it seems like you have to have a Sharpoint project open. This is where I’m having trouble to build the package.
any help is appreciated.
Update: I took the approach of simply building the C# project as it exists here. Then used WSPBuilder 2010 beta to build the WSP. Everything built fine. Was able to addsolution to SharePoint server, but when trying to deploysolution, I get the error “The method or operation is not implemented”. No other details on what’s failing. Verified that the feature is not getting deployed to the server.
any thoughts?
Seems like I’m talking to myself
but, hey, might was well finish off the thread. The problem was assertions in the feature handlers that weren’t being used. I simply commented ou the unused code, and all is good.
The only problem now is the limitation of reorder.aspx to paging only 100 items at time. This effectively limit the ranges that you can reorder items in the list. Haven’t seen any solutions posted anywhere on how to get around that.
I've got an idea: scprit it so that users of IE6 and below see nothing but a picture of a big old butt.That will show them. Show them a butt, that is.