EasyUI Forum

General Category => Bug Report => Topic started by: Stefan B. on February 28, 2014, 06:55:43 AM



Title: datagrid styler sets the class info to to cell <div> and table <td>
Post by: Stefan B. 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!


Title: Re: datagrid styler sets the class info to to cell <div> and table <td>
Post by: stworthy 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'
};
}
}


Title: Re: datagrid styler sets the class info to to cell <div> and table <td>
Post by: Stefan B. on March 04, 2014, 01:05:59 AM
THX for this answer. I will try the second code block.