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

114
Views
AG Grid moveColumn to ignore hidden columns

I am attempting to use ag-grid's moveColumn API. Our grid has the following default state:

{
    applyOrder: true,
    defaultState: {hide: true} // <-- debugging suggest this is line of issues
}

This means for columns that do not have a hide prop, it will auto be set to false.

However, when I use moveColumn, the API counts to hidden columns in the index count. For example:

Data:

[
    {
        colid: 'Name',
        hide: false,
        pivot: false,
        width: 100,
    },
    {
        colid: 'Age',
        hide: true,
        pivot: false,
        width: 100,
    },
    {
        colid: 'Gender',
        hide: true,
        pivot: false,
        width: 100,
    },
    {
        colid: 'Height',
        hide: true,
        pivot: false,
        width: 100,
    },
    {
        colid: 'Eye Colour',
        hide: false,
        pivot: false,
        width: 100,
    },
    {
        colid: 'Hair Colour',
        hide: false,
        pivot: false,
        width: 100,
    },

]

If i call columnApi.moveColumn('Eye Colour', 3); i would expect Eye Colour to appear after the Hair Colour column given Age, Gender and Height are all set to hidden.

Note, if I remove defaultState: {hide: true} then all works as expected however it is quite important to have this to handle unknown columns.

about 4 years ago · Santiago Trujillo
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!