我创建了一个自定义popup_editor
here,并创建了add
新记录时想要实现的目标
如果单选按钮Percentage
选中了禁用金额字段,否则,如果单选按钮Amount
选中了禁用百分比字段。 (请参见下图)。以及如何在文本字段中设置默认值?感谢您的帮助。
答案 0 :(得分:1)
尝试this
如果单选按钮“百分比”已选中,则禁用金额字段,否则为单选 按钮选中金额禁用百分比字段。 (请参见下图)
edit: function(e){
$('#RadioPercentage').change(
function(){
if ($(this).is(':checked')) {
$("#percentage").removeProp("disabled").removeClass("k-state-disabled");
$("#amount").prop("disabled", true).addClass("k-state-disabled");
}
});
$('#RadioAmount').change(
function(){
$("#amount").removeProp("disabled").removeClass("k-state-disabled");
$("#percentage").prop("disabled", true).addClass("k-state-disabled");
});
},
以及如何在文本字段中设置默认值?
尝试此操作(在“编辑”中),每次打开弹出窗口时,您都会找到该值,如果要执行一次,只需输入一个标志
$("[type='text']").val("default");
有人知道如何使用kendoNumericTextBox来表示百分比和金额吗? 感谢您的帮助
尝试this