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

Question bootstrap v5 responsive show/hide columns #1012

Open
periklis-periklis opened this issue May 19, 2022 · 2 comments
Open

Question bootstrap v5 responsive show/hide columns #1012

periklis-periklis opened this issue May 19, 2022 · 2 comments

Comments

@periklis-periklis
Copy link

Question,

jqgrid 5.6/7, jquery 3.6, bootstrap v5.

Do we need to listen for a resize event and add bootstrap v5 hide/show classes to columns or can we define bootstrap 5 hide classes as in the column definition using classes and labelClasses?.

e.g. column definition with bootstrap v5 would like to hide column when screen is smaller than 'lg'

{name:'col1', index:'col1', search:true, classes: "d-none d-lg-block", labelClasses: "d-none d-lg-block", searchoptions: {clearSearch:false}, editable:false, width:80, sortable:true, align:'left'},

If anyone can assist in answering question it is appreciated.

@tonytomov
Copy link
Owner

Hello,

The exact answer is: You will need to listen on resize and do showCol and hideCol methods to show hide columns. Adding bootstrap classes will not help.

I recommend you too if you got with this solution to use resizeGrid method.

if(ts.p.responsive) {

resizeGrid : function (timeout, width, height, refreshfrozen) {

Regards

@periklis-periklis
Copy link
Author

Thank You.

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

2 participants