Jump to content

hover over cell and change font to underline question


degerjy

Recommended Posts

I haven't find any way to get in dbgird one cell underlined when hover cursor over. Is there any way to do that?

Hover over is easy to handle with CSS, but that hapens for all cells (columns) in focused row and I want only particular cell is working that way.
The idea is that when user hover over some cells there comes underline and handcursor when there is possible to click that cell to get something more from that. 

Link to comment
Share on other sites

2 hours ago, degerjy said:

I haven't find any way to get in dbgird one cell underlined when hover cursor over. Is there any way to do that?

Hover over is easy to handle with CSS, but that hapens for all cells (columns) in focused row and I want only particular cell is working that way.
The idea is that when user hover over some cells there comes underline and handcursor when there is possible to click that cell to get something more from that. 

Hello,

One possible solution (demo: \FMSoft\Framework\uniGUI\Demos\Desktop\GridEditors).

1. UniServerModule.CustomCSS

.x-cursor-pointer {
  cursor:pointer !important;
}

.x-cursor-pointer:hover {
  text-decoration: underline; 
}

2. UniDBGrid1.ClientEvents.ExtEvents ->

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    //for the second column = LastName
    columns[1].renderer = function (value, meta, record) {
        meta.tdCls += 'x-cursor-pointer'; 
        return value;
    };
}

3. 

procedure TMainForm.UniDBGrid1CellClick(Column: TUniDBGridColumn);
begin
  if Column.FieldName = 'LastName' then
    ShowMessage(Column.Field.Value);

end;

 

Link to comment
Share on other sites

On 9/2/2020 at 9:29 PM, Sherzod said:

Hello,

One possible solution (demo: \FMSoft\Framework\uniGUI\Demos\Desktop\GridEditors).

1. UniServerModule.CustomCSS


.x-cursor-pointer {
  cursor:pointer !important;
}

.x-cursor-pointer:hover {
  text-decoration: underline; 
}

2. UniDBGrid1.ClientEvents.ExtEvents ->


function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    //for the second column = LastName
    columns[1].renderer = function (value, meta, record) {
        meta.tdCls += 'x-cursor-pointer'; 
        return value;
    };
}

3. 


procedure TMainForm.UniDBGrid1CellClick(Column: TUniDBGridColumn);
begin
  if Column.FieldName = 'LastName' then
    ShowMessage(Column.Field.Value);

end;

 

Sorry to say, but I couldn't get that work. No underline when hoovering over and at the same time all formats of that field (color, bold...) was gone.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...