EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jpierce on June 25, 2013, 08:00:14 AM



Title: datagrid styler function and bolding text
Post by: jpierce 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.


Title: Re: datagrid styler function and bolding text
Post by: stworthy 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


Title: Re: datagrid styler function and bolding text
Post by: jpierce on June 26, 2013, 06:56:09 AM
Yep, looks like 1.3.3 fixed it.  Thanks!