l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.58k stars 486 forks source link

How to resize column manually #1485

Closed joshi-anshul closed 3 years ago

joshi-anshul commented 3 years ago

I'm submitting a...

Question

Expected behavior

I want to add manual resize in datatable like this: https://www.gyrocode.com/articles/jquery-datatables-column-reordering-and-resizing/

So could you please let me know that how can we add this functionality using angular-datatable?

Environment


- node version: 14
- angular version: 10.1.3
- angular-cli version: 10.1.3
- jquery version: 3.5.1
- angular-datatables version: 10.0.0

Thanks

shanmukhateja commented 3 years ago

Hi, the article you provided uses a plugin ColReorderWithResize which is available on GitHub. Link

Here's a link to DataTables documentation regarding this plugin. Link

For future reference, this question is better suited at sites like StackOverflow.

Closing the issue. Feel free to re-open if you have any more inputs.

joshi-anshul commented 3 years ago

Thanks @shanmukhateja

Yes I already checked that plugin, but how can we use that plugin in "angular-datatable"?

In ref they include the ColReorderWithResize js, but in our case it throws error that it reuire jQuery as well. although we already used jQuery in module.

So could you please explain bit more?

Thanks

shanmukhateja commented 3 years ago

You need to add plugin initialization line to dtOptions:

dtOptions = {
/* your options here */
'dom': 'Rlfrtip' /* add here */
}
joshi-anshul commented 3 years ago

@shanmukhateja I have tried all options, but still column resize not working

looks like you have'n tried to implement yet using angular-datatable :( there is no angular way to implement this using this module(angular-datatable)

It would be highly appreciable if you can let me know the way to fix this, thanks!!

shanmukhateja commented 3 years ago

@joshi-anshul that's odd. It works as expected in my end. Try this project at link below:

https://github.com/shanmukhateja/adt-resize-col-demo

joshi-anshul commented 3 years ago

Thanks a lot @shanmukhateja

shanmukhateja commented 3 years ago

I'm closing this issue as it has been resolved.