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

186
Vistas
Ordering groups individual after renaming

My product table is sorted with initialSort by the product release month ascending. I also grouped my products by a codename which is determinate by the ajax json response url and renamed them to readable names with a groupBy function. Now I want to sort my groups individual without loosing the month sorting in my groups. How is that possible?

var table = new Tabulator("#tableid", {
  ajaxURL: url,
  layout: "fitColumns",
  groupBy: "codename",
  groupBy:function(data){
    if (data.codename == "X123") {
      return "Productname for X123";
    }
    if (data.codename == "X124") {
      return "Productname for X124";
    }
    …
    …
  },
  initialSort:[
      {column:"month", dir:"asc"}
  ],  
  columns: [
    { title: "Product", field: "codename"},
    { title: "Month", field: "month"},
    …
    …
    …
  ]
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Not exactly sure what you mean by "sort my groups individual", but is this what you're looking for ?

https://jsfiddle.net/r3f7pysw/

initialSort:[
      {column:"month", dir:"asc"},
      {column:"codename", dir:"asc"}
  ],

NOTE(1) : I dont think you want to return that string for your grouping, when it seems like its just the header Display string, and you're still going to be sorting on "codename" (becoz the string is the same with a change at the end, which really takes a "little" long to compare each time). But maybe you do...

NOTE(2) : Adding the seconds initialSort is like Ctrl-Click on the sorting to sort by multiple criteria. So if you single click on say, Month, remember that destroys the currentSort array and sets it just to Month.

about 4 years ago · Juan Pablo Isaza Denunciar
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