EasyUI Forum
September 13, 2025, 04:24:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: edatagrid and rowStyler  (Read 9405 times)
msvabik
Newbie
*
Posts: 30


View Profile
« on: June 21, 2016, 03:32:34 AM »

Hello,
I have a problem with repeated rowStyler at edatagrid.
Code:
<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"
Code:
<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"
Logged
msvabik
Newbie
*
Posts: 30


View Profile
« Reply #1 on: June 21, 2016, 04:03:18 AM »

For explanation: $('#uptime_{id}') will be replaced $('#uptime_45') using the template class in php
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 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.
Logged
msvabik
Newbie
*
Posts: 30


View Profile
« Reply #3 on: June 22, 2016, 03:20:23 AM »

Thank you, it works perfectly.
Logged
msvabik
Newbie
*
Posts: 30


View Profile
« Reply #4 on: June 22, 2016, 03:43:27 AM »

Now there is a deselection row at the end editing...
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!