Thank you,
it's working fine.
One more issue,
By Default button outside of the grid is disabled when I click the row the button is enabled it's not working, my script is this please look at this
My requirement is by default button is disabled when I click the grid row the external button is enabled with a checkbox (col.Type("checkbox") grid column
<button type="button" id="btnDisabled" class="btn btn-sm rebot-blue radius-btn" disabled><span class="rebot-custom-icon icon-arrow-small-27 small"></span>Disabled</button>
<div class="row">
<div class="col-xs-12">
@{
var DeptList = new Syncfusion.EJ2.DropDowns.DropDownList()
{
DataSource = ViewBag.dropdowndata,
Query = "new ej.data.Query()",
Fields = new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings() { Value = "value", Text = "text" },
AllowFiltering = true,
Placeholder = "Please Select",
FilterBarPlaceholder = "Search"
};
List<object> commands = new List<object>();
commands.Add(new { type = "Edit", tooltipText = "Edit", buttonOption = new { iconCss = "e-icons e-edit", cssClass = "e-flat" } });
//commands.Add(new { type = "Delete", tooltipText = "Delete", buttonOption = new { iconCss = "e-icons e-delete", cssClass = "e-flat" } });
commands.Add(new { type = "Save", tooltipText = "Save", buttonOption = new { iconCss = "e-icons e-update", cssClass = "e-flat" } });
commands.Add(new { type = "Cancel", tooltipText = "Cancel", buttonOption = new { iconCss = "e-icons e-cancel-icon", cssClass = "e-flat" } });
List<object> cols = new List<object>();
cols.Add(new { field = "OrgpsLastlogDt", direction = "Ascending" });
}
@Html.EJS().Grid("PracticeStaffGrid").DataSource(dataManager => { dataManager.Url("/Billing/UrlDatasource").UpdateUrl("/Billing/Update").RemoveUrl("/Billing/Delete").InsertUrl("/Billing/Insert").Adaptor("UrlAdaptor"); }).ShowColumnChooser(true).AllowTextWrap().AllowSorting(true).AllowFiltering(true).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel); }).Height(320).ActionComplete("actionComplete").RowSelected("rowSelected").Columns(col =>
@*@Html.EJS().Grid("PracticeStaffGrid").DataSource((IEnumerable<object>)ViewBag.griddatanew).ShowColumnChooser(true).AllowTextWrap().AllowSorting(false).AllowFiltering(true).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel); }).Height(320).Columns(col =>*@
{
col.Type("checkbox").ShowInColumnChooser(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Width("50").CustomAttributes(new { @class = "org_grid_header" }).Add();
//col.Field("OrgpsId").HeaderText(" ").Type("boolean").DisplayAsCheckBox(true).ShowInColumnChooser(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Width("50").CustomAttributes(new { @class = "org_grid_header" }).Add();
//col.AllowFiltering(false).AllowSorting(false).ShowInColumnChooser(false).Field("OrgpsId").HeaderText(" ").IsPrimaryKey(true).Template("#templateCheckbox").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Width("30").CustomAttributes(new { @class = "org_grid_header" }).Add();
col.Field("OrgpsName").IsPrimaryKey(true).HeaderText("Name").Width("180").CustomAttributes(new { @class = "org_grid_header" }).ValidationRules(new { required = "true", minLength = 15 }).Add();
col.Field("OrgpsEmail").HeaderText("Email").Width("180").CustomAttributes(new { @class = "org_grid_header" }).ValidationRules(new { required = "true", email = "true" }).Add();
col.Field("OrgpsAccess").HeaderText("Access").AllowFiltering(false).Width("120").ValueAccessor("DisplayDescription").EditType("dropdownedit").Edit(new { @params = DeptList }).CustomAttributes(new { @class = "org_grid_header" }).Add();
col.Field("OrgpsBusiness").HeaderText("Business").AllowEditing(false).Width("80").CustomAttributes(new { @class = "org_grid_header" }).Add();
col.Field("OrgpsLastlogDt").HeaderText("Last Login Date").AllowEditing(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Format("dd-MMM-yyyy").Width("100").CustomAttributes(new { @class = "org_grid_header" }).Add();
col.Field("OrgpsStatus").HeaderText("Status").Width("100").AllowEditing(false).CustomAttributes(new { @class = "org_grid_header" }).Add();
col.HeaderText("").Width("70").ShowInColumnChooser(false).Commands(commands).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).CustomAttributes(new { @class = "org_grid_header" }).Add();
}).AllowPaging().SelectionSettings(select => select.CheckboxMode(Syncfusion.EJ2.Grids.CheckboxSelectionType.ResetOnRowClick).Type(Syncfusion.EJ2.Grids.SelectionType.Single)).SelectionSettings(ss => ss.Mode(Syncfusion.EJ2.Grids.SelectionMode.Row)).PageSettings(page => page.PageSize(25).PageSizes(new string[] { "12", "25", "50", "100", "200" })).TextWrapSettings(text => { text.WrapMode(Syncfusion.EJ2.Grids.WrapMode.Both); }).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(false).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog); }).SortSettings(sort => sort.Columns(cols)).QueryCellInfo("tooltip").ActionFailure("actionFailure").Render()
</div>
</div>
<script>
function rowSelected(args) {
var gridObj = document
.getElementById('PracticeStaffGrid')
.ej2_instances[0]
gridObj.getSelectedRecords();
//alert("row index:" + args.row.getAttribute('aria-rowindex'));
//alert("column index: " + args.target.getAttribute('aria-colindex'));
$("#btnDisabled").prop("disabled", false);
//$("#btnDisabled").removeClass("disabled");
}
</script>
Thank you for your support