$("#GridEmpresaId_hidden").on("DOMSubtreeModified", function (e) {
var selectedText = $("#GridEmpresaId_hidden").find("option:selected").text();
var selectedValue = $("#GridEmpresaId_hidden").val();
console.log("Selected Text: " + selectedText + " Value: " + selectedValue);
});| @Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col => { . . . col.Field("ShipCountry").HeaderText("ShipCountry").Width("150").Add(); col.Field("ShipCity").HeaderText("ShipCity").Width("150").Add(); }).Height("400").Created("created").AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render() <script> . . . function created(args) { this.getColumns()[2].edit = { create: function () { countryElem = document.createElement('input'); return countryElem; }, read: function () { return countryObj.text; }, destroy: function () { countryObj.destroy(); }, write: function () { countryObj = new ej.dropdowns.DropDownList({ . . . }); countryObj.appendTo(countryElem); } }; this.getColumns()[3].edit = { create: function () { stateElem = document.createElement('input'); return stateElem; }, read: function () { return stateObj.text; }, destroy: function () { stateObj.destroy(); }, write: function () { stateObj = new ej.dropdowns.DropDownList({ . . . }); stateObj.appendTo(stateElem); } } } </script> |