问题
I am trying to change the label text of StudentOrEmployeeId
which is currently 'Name'. My change event is working but unable to change the name.May I am missing something
colNames: ['IssueType', 'Issued To','Name']
{ name: 'IssueType', index: 'IssueType', align: 'center', editable: true, edittype: 'select',
editoptions:
{
value: "0:Student;1:Teacher",
dataEvents: [{
type: 'change',
fn: function (e) {
if ($('#IssueType option:selected').val() == 0)
{
jQuery('tr#StudentOrEmployeeId > td.CaptionTD').html('Student Id')
}
else
{
jQuery('tr#StudentOrEmployeeId > td.CaptionTD').html('Employee');
}
}
}], }
},
{ name: 'StudentOrEmployeeId', 'index': 'StudentOrEmployeeId', editable: true, },
回答1:
label
property of formoptions of colModel
can be used to specify the label of Add/Edit form.
来源:https://stackoverflow.com/questions/23999261/change-label-text-add-form-in-jqgird