Hi Roberto,
Greetings from Syncfusion support.
We have validated the reported issue in the ASP.NET Core Sidebar
component. We have prepared a simple sample of the ASP.NET Core Sidebar
component, and the sample works fine without any console errors.
We would like to let you know that the reported issue occurs
due to an incorrect component ID used in the document.getElementById
method. To overcome the issue, we suggest you use the correct ID in the method.
We have attached the prepared sample for your reference.
Refer to
the below code snippet.
[_Layout.cshtml]
<ejs-sidebar id="default-sidebar" closeOnDocumentClick="false">
...
</ejs-sidebar>
<script>
document.addEventListener('DOMContentLoaded', function () {
//create instances for sidebar element
var defaultSidebar =
document.getElementById("default-sidebar").ej2_instances[0];
// Toggle Button to close and open the
sidebar
document.getElementById('toggle').onclick = function () {
defaultSidebar.toggle();
}
// Close the sidebar
document.getElementById('close').onclick = function () {
defaultSidebar.hide();
}
});
</script>
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Core_Sidebar1340346850.zip
Please
check the attached sample and get back to us if you need any further
assistance.
Note: If this post is helpful, please consider Accepting
it as the solution so that other members can locate it more quickly.
Regards,
Sivakumar S