Kendo 网格自定义可编辑弹出窗口
Kendo Grid custom editable popup
我创建了一个自定义 popup_editor
here,以及 add
新记录时我想要实现的目标,
如果单选按钮 Percentage
选中禁用金额字段,否则如果单选按钮 Amount
选中禁用百分比字段。 (请参阅下图)。以及如何在文本字段中设置默认值?谢谢你帮助我。
尝试this
If radio button Percentage checked disable amount field, else if radio
button Amount checked disable percentage field. (refer to image below)
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");
});
},
And how to do default value in text field?
试试这个(在 "edit" 内),每次打开弹出窗口时都会找到那个值,如果你想这样做一次,只需输入一个标志
$("[type='text']").val("default");
Any idea how I can use kendoNumericTextBox for percentage and amount?
Appreciate your help
尝试this
我创建了一个自定义 popup_editor
here,以及 add
新记录时我想要实现的目标,
如果单选按钮 Percentage
选中禁用金额字段,否则如果单选按钮 Amount
选中禁用百分比字段。 (请参阅下图)。以及如何在文本字段中设置默认值?谢谢你帮助我。
尝试this
If radio button Percentage checked disable amount field, else if radio button Amount checked disable percentage field. (refer to image below)
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");
});
},
And how to do default value in text field?
试试这个(在 "edit" 内),每次打开弹出窗口时都会找到那个值,如果你想这样做一次,只需输入一个标志
$("[type='text']").val("default");
Any idea how I can use kendoNumericTextBox for percentage and amount? Appreciate your help
尝试this