- Home
- Forum
- Angular - EJ 2
- Disable grid but not the scroll
Disable grid but not the scroll
Hi,
I need disabled the grid, I follow these steps
But it disable the scroll, I need that user can scroll horizontal
Thanks
SIGN IN To post a reply.
3 Replies
TS
Thavasianand Sankaranarayanan
Syncfusion Team
September 6, 2019 10:48 AM UTC
Hi Manolo,
Greetings from Syncfusion support.
We have analyzed the reported query “Disable grid but not the scroll” at our end.
We have achieved your requirement using manually adding and removing disablegrid class for grid elements. We suggest using the getContentTable and getHeaderTable method to fulfill your need.
Refer the below help documentation.
For your request, please refer the below code and sample
[app.component.css]
|
.disablegrid {
pointer-events: none;
opacity: 0.4;
}
.wrapper {
cursor: not-allowed;
} |
[app.component.ts]
|
public btnClick(): void {
if (this.Grid.getContentTable().classList.contains('disablegrid')) {
this.Grid.getContentTable().classList.remove('disablegrid');
this.Grid.getHeaderTable().classList.remove('disablegrid');
document.getElementsByClassName('e-toolbar')[0].classList.remove('disablegrid');
document.getElementById('GridParent').classList.remove('wrapper');
} else {
// To disable the grid table
this.Grid.getContentTable().classList.add('disablegrid');
// To disable the grid header
this.Grid.getHeaderTable().classList.add('disablegrid');
// To disable the Toolbar
document.getElementsByClassName('e-toolbar')[0].classList.add('disablegrid');
document.getElementById('GridParent').classList.add('wrapper');
}
} |
Please check the documentation/sample link and get back to us, if you require any further assistance on this.
Regards,
Thavasianand S.
MC
Manolo Capdevila
September 6, 2019 12:32 PM UTC
Ok, Thanks
But, it is possible, in future, that your grid has the property disabled and do it automatically?
TS
Thavasianand Sankaranarayanan
Syncfusion Team
September 9, 2019 11:08 AM UTC
Hi Manolo,
By default, we can disable the complete Grid by using that single CSS which we can used in our documentation but based on your query we found that you want to disable, except scrollbars in Grid. So, for your case we need to do customization in CSS and also we can achieve this by using the CSS style alone.
|
[app.component.css]
.e-grid table, .e-grid .e-toolbar {
opacity: 0.4;
pointer-events: none;
}
|
We have modified the previously provided sample in the following link.
Regards,
Thavasianand S.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
MC Manolo Capdevila
- Sep 5, 2019 12:24 PM UTC
- Sep 9, 2019 11:08 AM UTC