I have a kendo ui grid with a custom editor template. I want to be able to hide the editor for 2 fields on the popup editor based on the value of a 3rd field.
eg on the kendo grid if property a is set to true, then when the user selects edit and the popup shows, property b and c editors are not displayed. However if property a is false then editors(textboxes) for b and c must be shown on the popup.
I have tried to do the following:
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Events(e=>e.
Edit("Grid_Edit")
)
.Columns(columns =>
then
<script>
function Grid_Edit(e) {
var dataItem = e.dataItem;
var mode = e.mode;
var form = e.form;
if (dataItem.UseIntegratedSecurity)
$(form).find("#Username").hide()
}
</script>
to try and debug i have done the following:
<script>
function Grid_Edit(e) {
var dataItem = e.dataItem;
var mode = e.mode;
var form = e.form;
if (dataItem.IntegratedSecurity==true)
alert("integrated security")
}
</script>
But the alert is never displayed even when this field is set to true.
Am I on the right track or is there an easier way to achieve my goal?
eg on the kendo grid if property a is set to true, then when the user selects edit and the popup shows, property b and c editors are not displayed. However if property a is false then editors(textboxes) for b and c must be shown on the popup.
I have tried to do the following:
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Events(e=>e.
Edit("Grid_Edit")
)
.Columns(columns =>
then
<script>
function Grid_Edit(e) {
var dataItem = e.dataItem;
var mode = e.mode;
var form = e.form;
if (dataItem.UseIntegratedSecurity)
$(form).find("#Username").hide()
}
</script>
to try and debug i have done the following:
<script>
function Grid_Edit(e) {
var dataItem = e.dataItem;
var mode = e.mode;
var form = e.form;
if (dataItem.IntegratedSecurity==true)
alert("integrated security")
}
</script>
But the alert is never displayed even when this field is set to true.
Am I on the right track or is there an easier way to achieve my goal?