actionComplete: function (args) {
if (args.requestType == "add") { //add records $("#GriddataType").ejDropDownList({ 'change': 'onchange' })
var drpdwn1 = this.getContentTable(".gridfrom").find("#GriddataType").ejDropDownList("instance"); drpdwn1.setSelectedValue(1); var drpdwn2 = this.getContentTable(".gridfrom").find("#GridaggregationType").ejDropDownList("instance"); drpdwn2.setSelectedValue(1); } },
function onchange(args) { if (args.selectedText == "Text") { $("#GridaggregationType").ejDropDownList("disable") $('#Gridmaximumfieldlength').ejNumericTextbox('enable') } else if(args.selectedText == "Number"){ $('#Gridmaximumfieldlength').ejNumericTextbox('disable') $("#GridaggregationType").ejDropDownList("enable") } } |
$("#Grid").ejGrid({ dataSource: data, allowPaging: true,
. . . .
columns: [ { field: "metricfieldname", headerText: "Metric Name", isPrimaryKey:true, editType: ej.Grid.EditingType.String, width: 100 }, ] }); |
actionComplete: function (args) { if (args.requestType == "beginedit") { //edit records var args = {}; args.selectedText = $("#GriddataType").ejDropDownList("getValue"); //get value of selected text onchange(args); }
}, |
$(function () { var data = null; $("#Grid").ejGrid({ dataSource: data, allowPaging: true, allowSorting: true, allowGrouping: true,
actionComplete: function (args) { if (args.requestType == "beginedit") { var args = {}; args.selectedText = $("#GriddataType").ejDropDownList("getValue"); onchange(args); $("#GriddataType").ejDropDownList({ 'change': 'onchange' }) }
if (args.requestType == "add") { $("#GriddataType").ejDropDownList({ 'change': 'onchange' })
var drpdwn1 = $("#GriddataType").ejDropDownList("instance"); drpdwn1.setSelectedValue(1); var drpdwn2 = $("#GridaggregationType").ejDropDownList("instance"); drpdwn2.setSelectedValue(1); } }, editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, editMode: "dialog" }, });
});
function onchange(args) { if (args.selectedText == "Text") { $("#GridaggregationType").closest('tr').hide(); $('#Gridmaximumfieldlength').closest('tr').show(); } else if(args.selectedText == "Number"){ $('#Gridmaximumfieldlength').closest('tr').hide(); $("#GridaggregationType").closest('tr').show(); } } |
actionBegin: function(args){ if(args.requestType == "save"){ if(args.data && args.data.dataType == 1) delete args.data.maximumfieldlength } |