EasyUI Forum
September 13, 2025, 04:54:13 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: datagrid styler sets the class info to to cell <div> and table <td>  (Read 11217 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: February 28, 2014, 06:55:43 AM »

Is that correct that the styler of an datagrid field sets the new style to the cell <div> and table <td> element.
It should only set to the cell <div> element - or not?

Code:
  {field:'chk',title:'title',rowspan:2,width:150,
styler: function(value,row,index){
return "background:url('resources/themes/icons/gordis_system-customer-scope-true.png') center no-repeat";
}
}

See the following screenshot!
« Last Edit: February 28, 2014, 06:58:04 AM by Stefan B. » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 28, 2014, 06:29:34 PM »

That's the default behavior of inline styler. Another way is to define your owe CSS class and apply it to the cell.
Code:
<style>
.mybg{
background:url('resources/themes/icons/gordis_system-customer-scope-true.png') center no-repeat;
}
</style>
Code:
{field:'chk',title:'title',rowspan:2,width:150,
styler: function(value,row,index){
return {
class:'mybg'
};
}
}
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #2 on: March 04, 2014, 01:05:59 AM »

THX for this answer. I will try the second code block.
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!