Monday 28 October 2013

Converting the complex dropdown to a simple dropdown using SPServices

Introduction

The SPComplexToSimpleDropdown function lets you convert a "complex" dropdown rendered by SharePoint in a form to a "simple" dropdown. It can work in conjunction with SPCascadeDropdowns; call SPComplexToSimpleDropdown. SharePoint Lookup Column renders dropdowns differently in Internet Explorer depending on whether they have fewer than 20 options or 20+ options.


Object 



<script language="javascript" src="/_layouts/Server/NewScript/jquery.min.js"type="text/javascript"></script>
<script language="javascript" src="/_layouts/Server/NewScript/jquery.SPServices-0.7.1a.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function (){
  $().SPServices.SPComplexToSimpleDropdown({
            columnName: "City"
        });
    });</script>

The complex dropdown (as shown in the image above) is converted to a simple dropdown



Summary


In this Article We achieve if the parent list has more than 20 entries. SharePoint 2010 changes from a dropdown to an ajaxy-style 'type ahead'-field.Using SPServices SPComplexToSimpleDropdown We convert into simple dropdown.


No comments:

Post a Comment

SharePoint 2013 - Uploading Multiple Attachments To The New Item On List Using JSOM And REST API

  Introduction In this article, we will explore how we can attach multiple attachments to the new item on list using JSOM and REST API. Ther...