我正在尝试修改kendo ui网格中的column.filterable.ui。为此,我可以执行以下操作:
def svm_tuned_auroc(x_train, y_train, x_test, y_test, kernel='linear', C=0, logGamma=0, degree=0, coef0=0):
model = train_model(x_train, y_train, kernel, C, logGamma, degree, coef0)
decision_values = model.decision_function(x_test)
return optunity.metrics.roc_auc(y_test, decision_values)
但是,我希望能够根据变量调用格式来改变格式。使用字符串,我可以连接它,但是使用函数定义我很无能为力。
答案 0 :(得分:0)
var x = true;
filterable.ui = function (element) {
var fmt = 'n2';
if (x === true) {
fmt = 'y2';
}
element.kendoNumericTextBox({ format: fmt, decimals: 2 });
};