Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

193
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda