- Home
- Forum
- ASP.NET Core - EJ 2
- How to access column values using rowSelected
How to access column values using rowSelected
<ejs-grid id="reportGrid" dataSource="@Model.CreditReports" allowPaging="false" allowSelection="true" rowSelected="rowSelected" row>
<e-grid-selectionsettings enableSimpleMultiRowSelection="true" type="Multiple"></e-grid-selectionsettings>
<e-grid-columns>
<e-grid-column field="Id" visible="false" isPrimaryKey="true"></e-grid-column>
<e-grid-column field="ReportNumber" headerText="Report #" textAlign="Left"></e-grid-column>
<e-grid-column field="CustomerName" headerText="Customer" textAlign="Left"></e-grid-column>
<e-grid-column field="JointCustomerName" headerText="Joint Customer" textAlign="Left"></e-grid-column>
<e-grid-column field="Imported" headerText="Imported" headerTextAlign="Center" displayAsCheckBox="true" textAlign="Center"></e-grid-column>
<e-grid-column field="ImportedDate" headerText="Imported Date" format="dd/MM/yyyy"></e-grid-column>
</e-grid-columns>
</ejs-grid>
'
function rowSelected(args) {
var selectedrowindex = this.getSelectedRowIndexes(); // get the selected row indexes.
alert(selectedrowindex); // to alert the selected row indexes.
alert("Row " + selectedrowindex + " was selected."); // to alert the selected row indexes.
var selectedrecords = this.getSelectedRecords(); // get the selected records.
}
|
function rowSelected (args) {
// here you can get the data of currently selected row
console.log(args.data);
alert(JSON.stringify(args.data));
// here you can get the array of selected records.
var selectedrecords = this.getSelectedRecords(); // get the selected records.
console.log(selectedrecords);
} |
- 1 Reply
- 2 Participants
- Marked answer
-
RF Ron Fields
- Jul 23, 2020 07:53 PM UTC
- Jul 24, 2020 08:28 AM UTC