Title: edatagrid and rowStyler
Post by: msvabik on June 21, 2016, 03:32:34 AM
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"
Title: Re: edatagrid and rowStyler
Post by: msvabik on June 21, 2016, 04:03:18 AM
For explanation: $('#uptime_{id}') will be replaced $('#uptime_45') using the template class in php
Title: Re: edatagrid and rowStyler
Post by: stworthy on June 21, 2016, 07:12:02 PM
Please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.5-patch.zip.
Title: Re: edatagrid and rowStyler
Post by: msvabik on June 22, 2016, 03:20:23 AM
Thank you, it works perfectly.
Title: Re: edatagrid and rowStyler
Post by: msvabik on June 22, 2016, 03:43:27 AM
Now there is a deselection row at the end editing...
|