Hello,
I have a problem with repeated rowStyler at edatagrid.
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'west',split:true,border:false" style="width:50%">
<table id="uptime_{id}" fit="true">
<thead>
<tr>
<th data-options="field:'start'">{start}</th>
<th data-options="field:'delka'">{delka}</th>
<th data-options="field:'program'">{program}</th>
<th data-options="field:'title'">{title}</th>
<th data-options="field:'preklas'">{preklas}</th>
<th data-options="field:'klasifikace', editor:'numberbox'">{klasifikace}</th>
</tr>
</thead>
</table>
</div>
<div data-options="region:'center',border:false"></div>
</div>
<script type="text/javascript">
$(function(){
$('#uptime_{id}').edatagrid({
url:'servis.php?com=uptime&action=load&id={id}',
updateUrl:'servis.php?com=uptime&action=updateRow',
rowStyler: function(index,row){
var klas = +row.klasifikace;
switch(klas)
{
case 0: //Nevim
return {class:'nevim'};
break;
case 1: //Firma
return {class:'firma'};
break;
case 2: //Soukr
return {class:'soukr'};
break;
default:
return {class:'nevim'};
break;
}
}
});
});
</script>
When editing field klasifikace (0,1,2) => tag class="datagrid-row nevim soukr firma"
<tr id="datagrid-row-r1-2-3" datagrid-row-index="3" class="datagrid-row nevim soukr firma" style="">
Why this is happening?
Why is not it like that?
- for klasifikace=0, class="datagrid-row nevim"
- for klasifikace=1, class="datagrid-row firma"
- for klasifikace=2, class="datagrid-row soukr"