EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: gordis gmbh on September 26, 2016, 02:50:37 AM



Title: edatagrid: hide cell style in edit mode (SOLVED)
Post by: gordis gmbh 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!


Title: Re: edatagrid: hide cell style in edit mode
Post by: stworthy on September 26, 2016, 08:31:45 AM
Please try to remove the 'checkbox' editor from your 'SPOC' column.


Title: Re: edatagrid: hide cell style in edit mode
Post by: gordis gmbh 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!


Title: Re: edatagrid: hide cell style in edit mode
Post by: stworthy 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/


Title: Re: edatagrid: hide cell style in edit mode
Post by: gordis gmbh 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.


Title: Re: edatagrid: hide cell style in edit mode
Post by: stworthy 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/


Title: Re: edatagrid: hide cell style in edit mode (SOLVED)
Post by: gordis gmbh on October 05, 2016, 08:05:35 AM
Very good suggestion stworthy! The 'formatter' fits perfectly for my icon styling. Thanks very much!