Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148665 | Oct 29,2019 04:38 PM UTC | Nov 5,2019 03:38 AM UTC | ASP.NET MVC | 3 |
![]() |
Tags: Grid |
@Html.EJ().Button("mute").Size(ButtonSize.Large).ShowRoundedCorner(true).ClientSideEvents(e => e.Click("click")).Text("Mute") @(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowPaging()
.ClientSideEvents(eve => { eve.ActionComplete("actionComplete"); })
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
col.Type("checkbox").HeaderText("check").Width(90).Add();
})
)
<script>
var primaryKeyValuesArray = [];
function click(args) {
var selectedData = primaryKeyValuesArray; // array of primary key values
$.ajax({
// pass to controller
});
}
function actionComplete(args) {
if (args.requestType == "paging") {
var data1 = this.model.selectedRecords, len1 = data1.length, arrayLength = primaryKeyValuesArray.length;
for (i = 0; i < len1; i++) {
var value = data1[i]["OrderID"]; // orderID is primarykey column field
primaryKeyValuesArray.push(value);
console.log(primaryKeyValuesArray);
}
}
} </script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.