If your Kendo Grid uses popup mode, instead of displaying the Titles you assigned each column, the popup editor will display the actual field name i.e. 'functionalClassID' instead of 'Functional Class'
To change the lables in the popup editor declare an event in the edit mode of the grid:
.Sortable()
.Events(e =>
{
e.Edit("contacteditmode");
}
)
.Scrollable()
NOTE: Make sure it's the Events of the grid, not the DataSource
Include the following in your javascript:
function renameeditorcolumn(e, colname, newname) {
var test1 = e.container.find(colname).closest(".editor-field").prev();
for (var n = 0; n < test1.length; n++) {
var lab1 = test1[n];
//lab1.innerText = newname;
lab1.innerHTML = '<b>' + newname + '</b>';
}
}
And create your function that consumes it:
function contacteditmode(e) {
renameeditorcolumn(e, '#testDate', 'Test Date');
renameeditorcolumn(e, '#time', 'Test Time');
renameeditorcolumn(e, '#repeatedTestTypeID', 'Test Type');
renameeditorcolumn(e, '#functionalClassID', 'Functional Class');
renameeditorcolumn(e, '#OxygenSaturationatRest', 'O2 Saturation at Rest');
renameeditorcolumn(e, '#OxygenSaturationatExercise', 'O2 Saturation at Exercise');
renameeditorcolumn(e, '#OxygenSaturationatRecovery', 'O2 Saturation at Recovery');
renameeditorcolumn(e, '#pk_ResearchPhaseID', 'Research Phase');
renameeditorcolumn(e, '#walkDistance', 'Walk Distance');
}
NOTE: If you are using an EditorTemplate - the original name will be the PK specified in the template.
No comments:
Post a Comment