• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

130
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"},
    …
    …
    …
  ]
});
almost 3 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.

almost 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda