jaimi
|
|
« on: August 14, 2017, 10:35:44 PM » |
|
Is there a way to show or hide columns within a datagrid depending on a parameter? How to do that?
In the following sample I want to deal with that depending on the value of variable vPAR
sample: $(function(){
var vPAR = $('#vPAR').val(); //alert(vPAR);
$('#edgFirma').edatagrid({ title : 'Firma', iconCls:'icon-firma', width:'100%', height:'auto', collapsible : 'true',
columns:[[ {field:'OLT20A004T_KEY',title:'MandantKey',width:130,sortable:'true',hidden:'true'} ,{field:'OLT20A006T_KEY',title:'AdressKey' ,width:130,sortable:'true',hidden:'true'} // if vPAR == 1 the column should be shown ,{field:'OLT20A015T_KEY',title:'QuelleKey' ,width:130,sortable:'true',hidden:'true'} ,{field:'OLT00L001T_KEY',title:'LandKey' ,width:130,sortable:'true',hidden:'true'} ,{field:'PMA_NAME',title:'Mandant',width:150,sortable:'true',hidden:'true' ,editor:{ type:'textbox' ,options:{ required:true ,disabled:true ,prompt:'Mandant...' ,missingMessage: 'Geben Sie den Mandanten ein.' } }//editor }
|