I found the following link that helps me grey out the readonly fields. jqGrid: How to grey out read only fields on add/edit form dialog?
But im looking for something that helps me grey out fields that are disabled.
Any thoughts on how i can get this to work?
Editing to add code to explain my situation better. All my examples below are using the gray out code found in the link above.
This first piece of code was working perfectly with the solution on the link above to gray out the readonly parts. But we had to change it to a selection list.
//
// This grays out the field name and the input field. (But this had to be changed to a selection list for business reasons)
//
//{ name: 'tCode', index: 'tCode', width: 63, align: "left", editable: true, editoptions: { maxlength: "25", readonly: istCodeReadOnly } },
This next piece of code grays out the selection but not the field name next to it.
// This grays out the selection but not the field name
{
name: 'tCode', index: 'tCode', width: 63, align: "left", editable: true, editrules: { required: true }, edittype: "select", editoptions: {
disabled: istCodeReadOnly,
async: false, dataUrl: '@Url.Action("GettCodes", "Home")',
buildSelect: function (result) {
var response = $.parseJSON(result);
var s = '<select>';
$.each(response, function () {
s += "<option value='" + this.code + "' > " + this.description + "</option>";
});
return s + "</select>";
}
}
},
This was the first attempt when nothing was grayed out. Its like the readonly field was never recognized. Basically nothing happens.
// This does not gray out the field name or the field itself
{
name: 'tCode', index: 'tCode', width: 63, align: "left", editable: true, editrules: { required: true }, edittype: "select", editoptions: {
readonly: istCodeReadOnly,
async: false, dataUrl: '@Url.Action("GettCodes", "Home")',
buildSelect: function (result) {
var response = $.parseJSON(result);
var s = '<select>';
$.each(response, function () {
s += "<option value='" + this.code + "' > " + this.description + "</option>";
});
return s + "</select>";
}
}
},