EasyUI Forum
March 28, 2024, 07:38:25 AM *
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 function and bolding text  (Read 7895 times)
jpierce
Jr. Member
**
Posts: 73


View Profile
« on: June 25, 2013, 08:00:14 AM »

I've run into a bit of a problem with styling cells.  I can pass in a styler function and conditionally set the style of a cell.  The problem is that the datagrid only sets that style on the TD and the DIV that contains the text has some styles set on it that are overriding anything set on the TD.

For example, I wan't to bold certain cells.  So I have my styler return font-weight:bold.  The cells aren't bolded.  Investigating the code shows that the TD has font-weight:bold, but the child DIV has font-weight:normal.  The DIV's style override's the TD's style.  If I use the dev tools and remove the font-weight:normal style, then the TD's style passes through.

Suggestions on a workaround?  (My first thought was !important but of course that doesn't work here.)

Edit: My next thought, which worked, was to add a style in my CSS file for div.datagrid-cell { font-weight:normal }.  Are there any downsides to this approach?  I guess the next question is why does it bother settings those styles on the DIV instead of the TD.
« Last Edit: June 25, 2013, 08:02:04 AM by jpierce » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 25, 2013, 11:21:10 PM »

Please confirm you are using the lastest version 1.3.3. If not, download and use the version 1.3.3 or override the datagrid view as discussed in http://www.jeasyui.com/forum/index.php?topic=1827.0
Logged
jpierce
Jr. Member
**
Posts: 73


View Profile
« Reply #2 on: June 26, 2013, 06:56:09 AM »

Yep, looks like 1.3.3 fixed it.  Thanks!
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!