Override SP rendering for lists with 20+ items?

Dec 30, 2010 at 7:32 PM

Came across this blog: http://sharepointegg.blogspot.com/2010_10_01_archive.html

and found it useful, as the requirement to double-click a long list of items is something users have complained about.  I can get Wilson's script working, and the Cascading Dropdown as well - just not at the same time.  Wondering whether this is something you have considered incorporating?

Coordinator
Jan 3, 2011 at 3:07 PM

sjohns:

I assume that you mean this post:
http://sharepointegg.blogspot.com/2010/10/fixing-sharepoint-2010-lookup-drop-down.html

I have indeed thought about adding this to SPServices. In fact, I've had an issue in the Issue Tracker about this forever:
http://spservices.codeplex.com/workitem/5992
Well, at least since last May. ;+)

I left Wilson a comment asking if I could see the extension to SPServices he mentions. The trick will be to make sure that all of the other functions continue to work after doing this type of conversion. Wilson is simply hiding the existing control and adding a new one. SPServices will still find the "old" control on the page and try to work with that, so it's not a viable approach yet.

M.

Jan 4, 2011 at 4:49 PM

Sorry - I did find the previous discussion.   Should have stuck with that, rather than adding a new one!

For the time being, SPServices finding the old control isn't an issue for me.  Both my category and subcategory lists have well over 20 items, so to get it working, I overrode the dropdowns immediately, then passed in the name of the newly created dropdown (Wilson's script always prepends the same text - "tempDDLName"), like this:

<script>
    // Override the Cateogry Drop Down List
    var columnName = "Category";
    OverrideDropDownList(columnName);    
    // Override the Subcateogry Drop Down List
    var columnName2 = "Subcategory";
    OverrideDropDownList(columnName2);    
 </script>


<script type="text/javascript"  >
$(document).ready(function()
{
$().SPServices.SPCascadeDropdowns({
   relationshipList: "Subcategory",
   relationshipListParentColumn: "Category",
   relationshipListChildColumn: "Title",
   relationshipListSortColumn: "",
   parentColumn: "tempDDLName_Category",
   childColumn: "tempDDLName_Subcategory"

   });
 });

</script>

For this to work for the general public, you would have to keep track of whether or not it had been necessary to override the dropdown, then use the corresponding "old" or "new" control.  Will probably need to work on that in the near future - will send it along if I do.  (I also asked Wilson to send me the extended script, but didn't hear back either)