0
IM試圖讓metric_nme列的文本值,如果這是等於「賬戶審計」隱藏更新按鈕...獲得劍道列文本值
沒有人知道我怎樣才能得到的值劍道網格中的列?
這裏,如果我的代碼...
$("#assessmentGrid").kendoGrid({
dataSource: gridDS,
navigatable: true,
noRecords: {
template: "No assessments were found"
},
filterable: true,
sortable: {
mode: 'single',
allowUnsort: false
},
columns: [
{ field: 'assessment_pk', hidden: true },
{ field: 'role_fk', hidden: true },
{ field: 'role_nme', title: 'Role', width: 120 },
{ field: 'metric_fk', hidden: true },
{ field: 'assess_dte', hidden: true },
{
field: 'metric_nme', title: 'Metric', width: 150,
validation: {
metric_nme_validation: function (input) {
if (dataItem[metric_nme] = 'Accounts Audit') {
// attributes: { 'class': 'k-grid-update' }.
$("#k-grid-update").data("kendoGrid").visible = false;
}
}
}
},
{ field: 'assess_val', title: 'Score', width: 80, template: "#= (returnUnitMetricID(metric_fk) == 2) ? parseInteger(assess_val, 10) : assess_val #", attributes: { 'style': 'text-align: right' } },
{ field: 'adjust_val', title: 'Manager Score', width: 100, template: "#= (returnUnitMetricID(metric_fk) == 2) ? parseInteger(adjust_val, 10) : adjust_val #", attributes: { 'style': 'text-align: right' } },
{ field: 'adjust_by', title: 'Adjusted By', width: 120 },
{ field: 'comment_txt', title: 'Comment', hidden: true },
{ field: 'rating_cde', title: 'Rating', width: 95 },
{ field: 'adjusted_fk', hidden: true },
{ field: 'pct_to_goal', title: '% to Goal', width: 100, template: '#=kendo.format("{0:p}", pct_to_goal/100)#', attributes: { 'style': 'text-align: right' } },
{ field: 'lastupdate_by', title: 'Last Update By', width: 100 },
{ field: 'lastupdate_on', title: 'Last Update On', width: 130, template: "#= (lastupdate_on == null) ? '' : kendo.toString(kendo.parseDate(lastupdate_on, 'yyyy-MM-dd'), 'MM/dd/yyyy H:mm:ss') #" },
{
command: {
text: "Update",
click: updateScore,
}, title: " ", width: "60",
attributes: { 'class': 'k-grid-update' }
}
],
}).find("table").on("keydown", onGridKeydown);
function updateScore(e) {
e.preventDefault(e);
clearWindowPopUpFields();
$(".k-window").css('height', '420px');
$(".alert").hide();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var assestmentDate = new Date(dataItem.assess_dte);
$("#lbAssessmentDateRO").text($("#txtPeriod").val());
$('#lblMetric').text(dataItem.metric_nme);
$('#lblRole').text(dataItem.role_nme);
metricFk = dataItem.metric_fk;
$('#txtAssociate').text($('#cbAssociate').data("kendoComboBox").text());
switchScoreTypeControl(returnUnitMetricID(dataItem.metric_fk));
if (dataItem.assessment_pk == null) {
addScorePopUp(dataItem);
} else {
updateScorePopUp(dataItem);
}
}
請回答... – omid
你想隱藏的添加/編輯的行整列或只是一個值。你能描述一下流量和期望的輸出嗎? – Oskar
我只需要獲取網格加載時的列值,並將其與「帳戶審計」文本進行比較,如果這是真的,我想隱藏更新按鈕... – omid