简体   繁体   中英

SharePoint SPServices autocomplete not working for a column

I have a working jQuery SPServices code for a column Description in a list. The problem is, that when I try to get the data from another column, Project Item , with the same code, nothing happens. Also, when I try to put the code for the both columns, the code does not work for any. Both columns are of Single line of text type. The code is following:

<script language="javascript" type="text/javascript" src="/SiteAssets/Scripts/jquery-1.8.3.min.js"></script>
<script language="javascript" type="text/javascript" src="/SiteAssets/Scripts/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        document.getElementById('ctl00_m_g_b3f08547_27a4_484c_938a_f92864c47b7a_SPTextSlicerValueTextControl').title = 'Test';

        $().SPServices.SPAutocomplete({ 
            sourceList: "Projects",
            sourceColumn: "Project Item",
            columnName: "Test",
            ignoreCase: true,
            numChars: 2,
            slideDownSpeed: 50,
            debug: true
        });
    });
</script>

Check the docs for the autocomplete function. The sourceColumn name needs to be the StaticName for the column, which in this case is likely to be Project_x0020_Item.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM