EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: korenanzo on May 16, 2016, 09:36:56 AM



Title: datagrid-cellediting : highlight row
Post by: korenanzo on May 16, 2016, 09:36:56 AM
Hi,

when in cell edit mode, the current line is higlighted, css class  datagrid-row-editing

but if I select a cell in a column that is readonly, the row is no more in edit mode, so it loses the    datagrid-row-editing class

Is it possible to maintain the edit mode?

thanks,
RIc


Title: Re: datagrid-cellediting : highlight row
Post by: jarry on May 16, 2016, 03:31:41 PM
In cell editing mode, you can not select a whole row. You are only allowed to select cells on a row.


Title: Re: datagrid-cellediting : highlight row
Post by: korenanzo on May 17, 2016, 12:49:19 AM
Yea, I agree,

but I don't want to select a row, I want the highlight !

look,
this is a row with a cell in edit mode
you can see the blue line  , it is provided by the datagrid-row-editing class
(https://dl.dropboxusercontent.com/u/1181512/jeasy/A.png)
the gray column is a readonly column , provided by class="col_readonly"

when I am over the readonly column,  datagrid-row-editing disappears
(https://dl.dropboxusercontent.com/u/1181512/jeasy/b.png)


Id like to have the row higlited even in this case, because if I move between the cells using the keyboard, the flashing effect is really bad

here you can see the effect
https://dl.dropboxusercontent.com/u/1181512/jeasy/c.mov (https://dl.dropboxusercontent.com/u/1181512/jeasy/c.mov)


thanks

RIc


Title: Re: datagrid-cellediting : highlight row
Post by: korenanzo on May 20, 2016, 03:30:50 AM
so,

no possibility to highlight the row on which the currentCell is, when it (the cell) is readonly ?


Title: Re: datagrid-cellediting : highlight row
Post by: jarry on May 20, 2016, 06:28:12 AM
When enable cell editing, the highlighting row is disabled and the highlighting cell is enabled. The newest 'datagrid-cellediting.js' file can be downloaded from http://www.jeasyui.com/extension/datagrid_cellediting.php


Title: Re: datagrid-cellediting : highlight row
Post by: korenanzo on May 20, 2016, 08:27:06 AM
thank you jarry

anyway it not satisfies my needs .

I've patched it in this way:

Code:
onBeforeCellEdit: function (index, field) {
var o = $(this);
if  ([mycell is readonly..])
{
var panel = o.datagrid('getPanel').focus();
var cell = panel.find('td.datagrid-row-selected');
var oldTr=panel.find('tr.datagrid-row-editing');
if(oldTr)
oldTr.removeClass('datagrid-row-editing');
if(cell)
{
var tr = cell.closest('tr.datagrid-row');
if(tr)
tr.addClass('datagrid-row-editing');
}
return