Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Printing Table on SharePoint Page w/ Active Sorting

I have a table that was developed on a SharePoint page with column sorting. There is a Print button on the page that prints the following:

case "Print":
      var url = edmscPage.WebRelativeUrl + "/SitePages/PrintFilePlan.aspx?FilePlanId=" + FilePlan.Id + "&SourceUrl=" + encodeURIComponent(window.location.href);
      window.open(url);
      edmscPage.HideWaitScreenDialog();
      break;

The JS for the sorting is:

CreateClickableSortElement: function(name){
            var clickElement = edmscForm.CreateElement("span", [{Key: "onclick", Value: "FilePlanSortManager.MutationSortFilePlanItems(this)"}, {Key:"data-colname", Value: name}, {Key:"class", "Value":"sort-arrows"}], "↑↓");
            return clickElement;
        },
        MutationSortFilePlanItems: function(onclickElement){
            // Get the stored element column name attribute.
            var colName = onclickElement.getAttribute("data-colname");

            // Get our local mapping from the DOM column name.
            var mapping = GetColumnMapByDisplayName(colName);

            // To prevent weird behavior, reset everything (else) to the default ascending sort order.
            ResetUnusedMappings(colName);

            // Roll out the sorting property against the data objects in the back end.
            var sortProperties = mapping.DataColumns;

            // This starts as false on page load, so we flip early to make ascending our default sort order.
            // This keeps the variable in line with expected behavior, rather than the expected next stage.
            mapping.SortAsc = !mapping.SortAsc;

            FilePlanItem.Items.sort(function (a, b) {

                var comparisonStringA = "";
                var comparisonStringB = "";

                for(var s in sortProperties){
                    var property = sortProperties[s];
                    comparisonStringA += a[property];
                    comparisonStringB += b[property];
                }

                return comparisonStringA.localeCompare(comparisonStringB);
            });

            if(!mapping.SortAsc){
                FilePlanItem.Items.reverse();
            }
            
            document.getElementById("rrsFilePlanItems").innerHTML = "";
            FilePlanForm.LoadItemsSection();
        }
    }
})(FilePlanSortManager);

Any page that is printed loses its sorting. I want to be able to take that sorting the end user has and apply it to the print out page.

Thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!