I want to show column session
based on the corresponding row's cell value of type
. Already session
column is hidden.
To hide session
column i used this below piece of code,
{ name: 'session', index: 'session', hidden:true, editrules:{edithidden:true} },
So, I just want to show this column value only in view
. If type
cell value is equal to Full
, I want to hide session
in view
. Otherwise, I want to show that session
column value in view
.
I tried using this below code,
onSelectRow: function (id) {
var celValue = $('#statGrid').jqGrid('getCell', id, 'type');
if (celValue === 'Full') $('#statGrid').jqGrid('getColProp', 'session').editrules.edithidden = false;
if (celValue === 'Half') $('#statGrid').jqGrid('getColProp', 'session').editrules.edithidden = true;
}
Once, first if
condition get success edithidden
property changed to false
. So, It hides session
in View form. But I could not change that property to true
when my second if
condition get success.
Why this happened? Is this right way to do this task? or Is there any better way to do this?
recreateForm
for each view? – Dissimilation