Question

I've added this script to my EditForm.aspx and it works perfectly, except for one issue. I added an "Order" column of type number to each of the relationshipLists and introduced this column as the relationshipListSortColumn. The resulting sort order of the child options is by "ID" and not by "Order". If I set the SortColumn to "Title" or "ID" it sorts as expected.

    <script
  src="https://code.jquery.com/jquery-2.2.4.min.js"
  integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
  crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js"></script>

<script type="text/javascript">

   $(document).ready(function(){
               $().SPServices.SPCascadeDropdowns({
                   relationshipList: "{7E9AA6F4-6E33-4533-8144-FFB9364E8C18}",
                   relationshipListParentColumn: "Chapter",
                   relationshipListChildColumn: "Title",
                   relationshipListSortColumn: "Order",
                   parentColumn: "Chapter Required Field",
                   childColumn: "Section",
                   debug: true
               });            

               $().SPServices.SPCascadeDropdowns({
                   relationshipList: "{5BCE574B-0E5E-471A-A72C-792ECD552234}",
                   relationshipListParentColumn: "Section",
                   relationshipListChildColumn: "Title",
                   relationshipListSortColumn: "Order",
                   parentColumn: "Section",
                   childColumn: "Subsection",
                   debug: true
               });             
        }
      );

</script>
Was it helpful?

Solution

You can go to the list settings->click the order column to access edit column page, check the URL in the address bar.

enter image description here

In my environment, the order column internal name is "order0", then I change the "order" to "order0" in the code as relationshipListSortColumn: "order0", it works well.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top