Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column is not updated when columns are moved. #18

Open
KyGuyMayor opened this issue Jan 17, 2019 · 7 comments
Open

Column is not updated when columns are moved. #18

KyGuyMayor opened this issue Jan 17, 2019 · 7 comments

Comments

@KyGuyMayor
Copy link

When I move a column, the colReorder.order() function still returns the indexes in the default order.

@jeffreydwalter
Copy link
Owner

Are you calling order() yourself? Can you provide a piece of code that reproduces the issue?

The order() function takes two arguments: https://github.com/jeffreydwalter/ColReorderWithResize/blob/master/ColReorderWithResize.js#L1739-L1749

@KyGuyMayor
Copy link
Author

perhaps I have a misunderstanding of the function. Is there a way to return the current column order after a user has re-ordered columns?

@jeffreydwalter
Copy link
Owner

@KyGuyMayor nah, you're right. I don't really use this library anymore, so I'm a bit rusty on the API.

@jeffreydwalter
Copy link
Owner

If you could provide a work (not working) example, I'd be happy to debug it for you (or I will happily accept a pull request that fixes the issue).

@vmarinaro
Copy link

Hi, I have try to fix it in this way. In Move the internal array elements after Colums options regenerate I inserted this code.

/* regenerate event handlers for the drag and drop */
  for ( i=0, iLen=iCols ; i<iLen ; i++ )
  {
      if ( i > oSettings._colReorder.s.fixed-1 && i < iLen - oSettings._colReorder.s.fixedRight )
      {           
          oSettings._colReorder._fnMouseListener( i, oSettings.aoColumns[i].nTh );
      }       
  }

@jeffreydwalter
Copy link
Owner

@KyGuyMayor does this fix the problem? If so, please make a PR and I'll merge in your changes.

@KyGuyMayor
Copy link
Author

Sorry for the super late reply. I no longer have access to the project that was using this due to a job change. So I am unable to properly test it. I am okay with this being closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants