Jump to content

Grid indicator


arilotta

Recommended Posts

Sure, I've prepared a simple test case, see link below on Google Drive.

It is quite simple: under the UniDbGrid Options section there is the dgIndicator flag, which is supposed to show the grid indicator in the first column of the selected row (a small triangle). At runtime, on the contrary, no grid indicator is shown even though dgIndicator is true.

 

 


 

Thank you

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I'm trying to achieve the grid indicator feature by adding as the first column and image showing a triangle that resembles the well known standard Delphi 

grid indicator.

The problem I am facing here is that it has to be shown only on the selected row, while it should be hidden for all the other rows.

Ideas on how to achieve this ?

Thanks

Link to comment
Share on other sites

Hi,

 

Something like this:

 

CustomCSS:

.custom-grid .x-grid-row-selected .x-grid-cell-first {
    background-image: url(/files/bullet.png);
    background-repeat: no-repeat;
}

function beforeInit:

function beforeInit(sender, config)
{
    config.cls = 'custom-grid';
}

Best regards,

Link to comment
Share on other sites

  • 1 year later...

I've found a possible solution looking at thread:

http://forums.unigui.com/index.php?/topic/6884-unidbgrid-rowselect/?hl=selectionchange&do=findComment&comment=35012

 

In addition to use "cellModel.deselect" and "cellModel.selectionchange", I used grid OnAfterLoad event to initialize the grid afetr being loaded:

 

procedure TFrameDlgEvent20011.GRDCatAfterLoad(Sender: TUniDBGrid);
begin
  UniSession.AddJS(GRDCat.JSName+'.view.getNode('+IntToStr(GRDCat.CurrGridRow)+').className = ''x-grid-row x-grid-data-row x-grid-row-selected''');
end;
 
CurrGridRow is the CurrRow protected property defined in TUniBasicGrid that can be accessed using the usual THackGrid trick or a class helper,
like a did (to access protected members....):
 
type TUniDBGridHelper = class helper for TUniDBGrid
...
...
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...