Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda