Hi Abaid,
Greetings from syncfusion support.
Query #1: Following two directives are not available in EJ2.@using Syncfusion.JavaScript;@using Syncfusion.JavaScript.Models;
In EJ2 grid control there is no need of above directives instead that we should add below dependencies in the core application.
1. Using Nuget Package Manager we need to add Syncfusion.EJ2.AspNet.Core package into your application.
2. We need to install NewtonSoft.JSON as dependency since Syncfusion.EJ2.AspNet.Core dependent to NewtonSoft.JSON package.
Refer the below link to create a ASP.NETCORE with Gird control.
Query #2: I have researched & modified the code as below. However, in following code, line 1 & 2 works fine but run-time error is thrown on row.hide() citing 'hide' method is not available.
We are happy to hear that you have found how to get the grid instances in EJ2.
The hide() is a JQuery method, which is used to hide the selected element in the DOM. Since we have used pure javascript in EJ2 components. You can hide the element by adding class list e-hide for the selected row element to achieve your requirement. Please refer the below code example and sample for more information.
var grid = document.getElementsByClassName('e-grid')[0].ej2_instances[0];
var selectedRows = grid.getSelectedRows();
for (var i = 0; i < selectedRows.length; i++) {
// syncfusion way
selectedRows[i].classList.add('e-hide');
// you can also hide selected row element using html attributes
// selectedRows[i].hidden = true;
// selectedRows[i].style.display = 'none';
} |
Please get back to us if you need further assistance.
Regards,
R.Dhivya