関数から返された bool 値に基づいて、jqGrid チェックボックスを無効/有効にできるようにしたいと考えています。どうすればいいですか?
以下のコードのスニペット
colModel: [
{ name: 'IsSystemAdmin', index: 'IsSystemAdmin', width: 50, align: "center",
formatter: "checkbox",
formatoptions: { disabled: isSystemAdmin}, editable: true }
],
*関数を呼び出す場所に注意してください: formatoptions: { disabled: isSystemAdmin}, editable: true } *
var isSystemAdmin = new function(){
//do something and return a bool value
}
また
function isSystemAdmin(){
//do something and return a bool value
}
上記のコードが実際に機能することは明らかです。変更のみ:
formatoptions: { 無効: isSystemAdmin()}
それ以外の
formatoptions: { 無効: isSystemAdmin}