문제

I see many posts regarding the order grid color change, but I want to know how to change the product grid color change.

If anybody else did this, please let us know.

도움이 되었습니까?

해결책

Please copy those files and move them to the your theme. add this code in below file

 attr="style: getColorStyle($row())"

vendor/magento/module-ui/view/base/web/templates/grid/listing.html

 <tr class="data-row" repeat="foreach: rows, item: '$row'" css="'_odd-row': $index % 2" attr="style: getColorStyle($row())">
  <td outerfasteach="data: getVisible(), as: '$col'" css="getFieldClass($row())" click="getFieldHandler($row())" template="getBody()"/>
 </tr> 

and add this function in below file

 getColorStyle: function(row)
 {
  /*
   var jsonData = JSON.stringify(row);
   console.log(jsonData);
  */
    styles = '';
  if(row['status'] == '1'){
   styles =  'background: #fefafa';
  }else if(row['status'] == '2'){
   styles =  'background: #6a0dad';
  }else{
    styles = '';
  }
  return styles;
 }

vendor/magento/module-ui/view/base/web/js/grid/listing.js

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top