EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: patana on July 08, 2020, 10:57:30 PM



Title: How to set datagrid background color and row selected background color
Post by: patana on July 08, 2020, 10:57:30 PM
Hi dear,
When ever i use rowStyler:myRowstyler in datagrid, it's always overwrite the datagrid-row-selected style color.
Any other way to set background color to row and row-seleceted?
Thanks.


Title: Re: How to set datagrid background color and row selected background color
Post by: jarry on July 08, 2020, 11:54:23 PM
You can define the highlight row class and return it in some conditions. Please refer to the code below.

Code:
<style type="text/css">
  .my-row:not(.datagrid-row-selected){
    background-color:#6293BB;
    color:#fff;
    font-weight:bold;
  }
</style>
<script type="text/javascript">
  function rowStyler(index,row){
    if (row.listprice < 30){
      return {class:'my-row'};
    }
  }
</script>


Title: Re: How to set datagrid background color and row selected background color
Post by: patana on July 09, 2020, 01:12:18 AM
Thank you!