Jump to content

StringGrid Questions


mos

Recommended Posts

  • 2 weeks later...

Hi,

 

Can you try this approach for now?:

 

1. Follow the steps as in this post: http://forums.unigui.com/index.php?/topic/9122-tunidbgrid-color-combo/

 

2. UniDBGrid1 -> Columns -> "comboColor" column: Editor -> UniComboBox1

    function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) 
    {
        var me = sender;

        columns[1].renderer = function(v) {
            return '<span style="float: left; width: 33px; height: 15px; background: ' + getHexa(v) + '">        </span> ' + v;
        }
    }

    MainForm -> OnReady:

procedure TMainForm.UniFormReady(Sender: TObject);
begin
    UniStringGrid1.JSInterface.JSCall('columnManager.columns[1].setEditor', [UniComboBox1.JSControl])
end;

Result:

post-906-0-70929000-1519281793_thumb.png

 

Best regards,

Link to comment
Share on other sites

  • 1 month later...

Hi Delphi Developer,

 

  I've noticed that if I use this code you provide:

UniStringGrid1.JSInterface.JSCode(#1'.rc[2][2]="background-color:green; color:white";'#1'.view.refresh();');

 Using the above as an example the cell[2,2] will have a background color of green but if you highlight this row and have row select  set to True, the row selection bar is not visible in cell[2,2] but is visible in cells that don't use the above code?

Link to comment
Share on other sites

Hi Delphi Developer,

 

  Another question.

 

  I need to center an image in a stringgrid cell and based on what I have seen I need to set the following in the DIV:

style="text-align:center"

 I added the following to the CustomCSS in the ServerModule:

.supergrid .x-grid-cell-inner {
   text-align: center
}

What do I need to do to apply the above CSS to the DIV?

Link to comment
Share on other sites

And please, can you capture an area of your app and save it directly to .GIF, for example by using LICEcap, so that we can see what's happening ?

 

In the attachment provided the row select bar is blue and the yellow first two columns are where the JS code was applied.

 

In this example you can see that the blue bar does not cover the yellow cells when the row is highlighted.

post-5257-0-57130800-1523595798_thumb.png

Link to comment
Share on other sites

Hi Delphi Developer,

 

  Is there update on this as I need to be able to center an image in a cell?

 

 

Hi Delphi Developer,

 

  Another question.

 

  I need to center an image in a stringgrid cell and based on what I have seen I need to set the following in the DIV:

style="text-align:center"

 I added the following to the CustomCSS in the ServerModule:

.supergrid .x-grid-cell-inner {
   text-align: center
}

What do I need to do to apply the above CSS to the DIV?

Link to comment
Share on other sites

  • 2 weeks later...

Hi Delphi Developer,

 

  Is it possible to remove the cell focus highlight so that no cell is highlighted in the stringgrid?

 

  is it possible to set the background color of the column titles row when ShowColumnTitles is True?

 

  Also is it possible to trap the click event on column title cells and then be able to call some other Delphi code?

Link to comment
Share on other sites

Hi Delphi Developer, 

 

Hi,

ReadOnly = True ?

 

  I had already tried setting the Enabled to False but it grays out the grid.

 

  I want the grid to appear normally without any cell focus highlighted.

Link to comment
Share on other sites

Hi Delphi Developer,

 

  If I have goRangeSelect enabled in VCL StringGrid  we can normally use the Selection property to find out what cells are selected.

 

 Is there a way of doing this in UniStringGrid as I noticed there is a goRangeSelect but no Selection property?

Link to comment
Share on other sites

  • 1 month later...

Hi!

There is CSS problem with TUniStringGrid in 6.5.3

 

Later i was using this CSS for fitting all table cells on panel

.SGGL .x-grid-table {
height: 100%;
width: 100%;
}
.SGGL .x-grid-cell-Inner {
text-align: center !important;
}
.SGGL .x-grid-cell {
vertical-align : middle !important;
}
function beforeInit(sender, config)
{
config.cls = "SGGL";
}

After update to 6.5.3 this CSS is not full workable.

I tried different x-grid and panels parameters for repair, but no results

 

Could you please help me to correct this CSS? Or may be somebody had the same trouble with new ExtJS.

 

Thank You!

 

I attached 2 pictures: normal situation and after 6.5.3.

post-3740-0-59190900-1528184269_thumb.png

post-3740-0-40936800-1528184282_thumb.png

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...