Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: SPCascadeDropDowns not working if parent field required even with jquery.SPServices-2014.01.js

$
0
0
While reviewing other pages in our site, I found two other list where we use the cascading drop downs, but they also add our "Team" selection under the Division.
EX: Site => Division => Team

"Site" and "Division" are both required. "Team" is not. With the 2014.01.js version, a selection of a "Site" (select) does not cascade to Division (complex drop down), all divisions are listed. However, the selection of a Division does cascade/filter the options in the "Team" (complex drop down).

NOTE: in the post above I have changes the relationshipListChildColumn to "SURVICE_x0020_Division". This is a minor change as this column and "Title" contain the same information, but I changes to keep consistent with implementations on other pages. Also removed the relationshipListSortColumn as it will default to the relationshipListChildColumn.

Here is the rendered HTML of the Site => Division => Team setup:
<tr>
        <td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
        <nobr>SURVICE Site<span class="ms-formvalidation" title="This is a required field." > *</span></nobr>
    </h3></td>
        <td valign="top" class="ms-formbody">
        <!-- FieldName="SURVICE Site"
             FieldInternalName="SURVICE_x0020_Site"
             FieldType="SPFieldLookup"
          -->
            <span dir="none"><select name="ctl00$m$g_147d12b8_8feb_4b4c_9eab_7f3f26da87be$ctl00$coifieldlock1$ctl19$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_147d12b8_8feb_4b4c_9eab_7f3f26da87be_ctl00_coifieldlock1_ctl19_ctl00_ctl00_ctl04_ctl00_Lookup" title="SURVICE Site Required Field">
            <option value="1">Operation 1</option>
                    <option value="2">Operation 2</option>
                    <option selected="selected" value="3">Operation 3</option>
                    .....

                </select><br/></span>
            
            
        </td>
    </tr>
    
        <tr>
        <td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
        <nobr>SURVICE Division<span class="ms-formvalidation" title="This is a required field." > *</span></nobr>
    </h3></td>
        <td valign="top" class="ms-formbody">
        <!-- FieldName="SURVICE Division"
             FieldInternalName="SURVICE_x0020_Division"
             FieldType="SPFieldLookup"
          -->
            <span dir="none"><span style="vertical-align:middle"><input name="ctl00$m$g_147d12b8_8feb_4b4c_9eab_7f3f26da87be$ctl00$coifieldlock1$ctl20$ctl00$ctl00$ctl04$ctl00$ctl01" type="text" value="DIVISION 2" id="ctl00_m_g_147d12b8_8feb_4b4c_9eab_7f3f26da87be_ctl00_coifieldlock1_ctl20_ctl00_ctl00_ctl04_ctl00_ctl01" class="ms-lookuptypeintextbox" onfocusout="CoreInvoke('HandleLoseFocus')" opt="_Select" title="SURVICE Division" optHid="SPSURVICE_x0020_Division_Hidden" onkeypress="CoreInvoke('HandleChar')" onkeydown="CoreInvoke('HandleKey')" match="" choices="(None)|0|DIVISION 1|1|DIVISION 2|2|DIVISION 3|3|DIVISION 4|4|....." onchange="CoreInvoke('HandleChange')" /><img alt="Display lookup values" onclick="CoreInvoke('ShowDropdown','ctl00_m_g_147d12b8_8feb_4b4c_9eab_7f3f26da87be_ctl00_coifieldlock1_ctl20_ctl00_ctl00_ctl04_ctl00_ctl01');" src="/_layouts/images/dropdown.gif" style="border-width:0px;vertical-align:middle;" /></span><br/></span>
            
            
        </td>
    </tr>
    
        <tr>
        <td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">
        <nobr>SURVICE Team</nobr>
    </h3></td>
        <td valign="top" class="ms-formbody">
        <!-- FieldName="SURVICE Team"
             FieldInternalName="SURVIC_x0020_Team"
             FieldType="SPFieldLookup"
          -->
            <span dir="none"><span style="vertical-align:middle"><input name="ctl00$m$g_147d12b8_8feb_4b4c_9eab_7f3f26da87be$ctl00$coifieldlock1$ctl21$ctl00$ctl00$ctl04$ctl00$ctl01" type="text" value="TEAM 4" id="ctl00_m_g_147d12b8_8feb_4b4c_9eab_7f3f26da87be_ctl00_coifieldlock1_ctl21_ctl00_ctl00_ctl04_ctl00_ctl01" class="ms-lookuptypeintextbox" onfocusout="CoreInvoke('HandleLoseFocus')" opt="_Select" title="SURVICE Team" optHid="SPSURVIC_x0020_Team_Hidden" onkeypress="CoreInvoke('HandleChar')" onkeydown="CoreInvoke('HandleKey')" match="" choices="(None)|0|TEAM 1|1|TEAM 2|2|TEAM 3|3|TEAM 4|4|TEAM |5|TEAM 6|6|TEAM ....." onchange="CoreInvoke('HandleChange')" /><img alt="Display lookup values" onclick="CoreInvoke('ShowDropdown','ctl00_m_g_147d12b8_8feb_4b4c_9eab_7f3f26da87be_ctl00_coifieldlock1_ctl21_ctl00_ctl00_ctl04_ctl00_ctl01');" src="/_layouts/images/dropdown.gif" style="border-width:0px;vertical-align:middle;" /></span><br/></span>
            
            
        </td>
    </tr>
The scripts:
    $(document).ready(function() {
        $().SPServices.SPCascadeDropdowns({
            relationshipList: "{B61486E8-6E9E-46A1-B630-DD245F37C048}",
            relationshipListParentColumn: "SURVICE_x0020_Site",
            relationshipListChildColumn: "SURVICE_x0020_Division",
            parentColumn: "SURVICE Site",
            childColumn: "SURVICE Division"
        });
     
        $().SPServices.SPCascadeDropdowns({
            relationshipList: "{2BD93A3C-665C-45BB-9C52-239629052ED9}",
            relationshipListParentColumn: "SURVICE_x0020_Division",
            relationshipListChildColumn: "SURVICE_x0020_Teams",
            parentColumn: "SURVICE Division",
            childColumn: "SURVICE Team"
                    });
        });

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>