EasyUI Forum
April 29, 2024, 11:17:45 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: edatagrid: hide cell style in edit mode (SOLVED)  (Read 7276 times)
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« on: September 26, 2016, 02:50:37 AM »

I am showing a checkbox-image in cells of columns having boolean type (please see the attached screenshot).

The problem is a part of this checkbox-image is visible in the background while editing the field.

How can I temporarily hide / remove the style while in edit mode?

Thanks!
« Last Edit: October 05, 2016, 08:06:09 AM by gordis gmbh » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 26, 2016, 08:31:45 AM »

Please try to remove the 'checkbox' editor from your 'SPOC' column.
Logged
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #2 on: September 27, 2016, 04:05:03 AM »

Hello stworthy,

checkbox editor is required for editing the cell. Only the background needs to be temporarily hidden when the checkbox editor is shown.

Please see the example here: http://jsfiddle.net/tk19zpd0/7/

How can I temporarily hide / remove the cell-style while in edit mode?

Also refer the attached screenshot!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 27, 2016, 07:48:34 AM »

You need to return null from the 'styler' function when editing a row. Please look at this updated example.
http://jsfiddle.net/tk19zpd0/8/
Logged
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #4 on: October 05, 2016, 01:16:04 AM »

Hi stworthy.

you just don't return null from the styler but in onBeforeEdit, you also set a flag 'row.isEditing' and refresh the entire row to force a call on the styler.

This is a clear workaround to handle one or two special cases. But in my opinion this should be included in the source..  such that before loading cells with checkbox editor, the styler is set to null by default. In case of other editors, the styling is anyway not visible.

I have some 60 edatagrids with multiple style-based columns. A refresh row for every edit may cause a performance issue as well. Thanks for sharing your opinion.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: October 05, 2016, 02:37:13 AM »

The 'styler' is applied to the whole row, regardless whether or not the row is edited. So you have to set some flags to return the corresponding styles in this function. If you only want to display some icons on the column, using the 'formatter' function may be more appropriate. Please look at this example.

http://jsfiddle.net/tk19zpd0/15/
Logged
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #6 on: October 05, 2016, 08:05:35 AM »

Very good suggestion stworthy! The 'formatter' fits perfectly for my icon styling. Thanks very much!
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!