EasyUI Forum
June 25, 2024, 11:27:14 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 image on cell  (Read 6931 times)
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« on: November 26, 2015, 04:13:28 PM »

hello and thanks in advance for your support,
I have one datagrid, with url loading method.
the columg gets its data from the server:
<th data-options="field:'myDataBaseField',width:20,styler:cellStyler">xxx</th>
everything works ok. I have also the cellStyler function to change background color of the cell if value meets specific requirements:function cellStyler(value,row,index){
   if (value == 0){
      return 'background-color:#ffee00;color:red;';
   }
}
the problem is I want to put one image on the cell, not change the background color.
any idea will be very appreciated, I'm stuck on it,
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 26, 2015, 11:32:33 PM »

Please try to use the 'formatter' function instead.
Code:
formatter: function(value, row){
  if (value == 0){
    return '<img src.../';
  }
}
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!