CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Simultaneous visibility of header row and summary row

by jorgo » 03 Jul 2017 08:57

Hi,

I have a modal dialog with TIWCGJQGrid + TIWCGJQGridCellsProvider on it.
I show the column header area and a summary row area, but no pager area.

If I show a few rows (without scrollbar) both areas are visible.
If I show more rows then I see the header area and the top rows but no summary area.
If I scroll down the header area vanishes and at the end the summary area is visible.

My question, is there a possibility to fix both areas?
It would be nice to see them both during scrolling.

Kind regards
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 03 Jul 2017 10:00

Hi jorgo,

But the JQGrid have the both (header & footer) fixed by default..
Can you submit the simple testcase please? T.I.A

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by jorgo » 03 Jul 2017 15:13

Hi Alexander,

here is my test app.

Following problems:

1.) We have 50 grid rows. If we scroll, only column header or summary row is visible.
2.) All cells of col1 have a new color. If we select a row, the selection-bar is broken at col1.

Kind regards
You do not have the required permissions to view the files attached to this post.
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 04 Jul 2017 10:35

Hi jorgo,

Set the Grid1.CGScrollStyle to default value (cgsbsIWDefault).

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by jorgo » 04 Jul 2017 11:23

Thx Alexander,

1.) CGScrollStyle -> cgsbsIWDefault worked. (Don't know why I changed it) :?

2.) I still have this second Problem
All cells of col1 have a new color. If we select a row, the selection-bar is broken at col1.
Idea: Is it possible to change the ZIndex of cell or selection-bar?

Should I open a new post?

Code: Select all
with JScript do
begin
    Clear;
    Add('function (rowId,val,rawObject,cm,rdata){');
    Add('  return " style=\" background:orange \" ";');
    Add('}');
end;
Grid1.JQGridOptions.ColModel[1].OnCellAttr.Script:= JScript.Text;


Kind regards
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 04 Jul 2017 12:19

Hello,

Use the
Code: Select all
!important
on css style.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by jorgo » 10 Jul 2017 10:16

Hi,

I have not done it.

I think the reason for my problems is the art of creating the grid.
If read that the grid is painted in layers.
(grid body -> grid columns and rows -> grid cell)
At the top is the painting of the cell.
I think my assignments to focused row and hover row are ignored.

My example code:

Code: Select all
uses IWCGJQCommon;

procedure TForm1.IWAppFormCreate(Sender: TObject);
var
  JScript : TIWCGJScript;

begin
  // 1.) Set color of second column to BLUE
  JScript:= TIWCGJScript.Create;
  try
    with JScript do
    begin
      Clear;
      Add('function (rowId,val,rawObject,cm,rdata){');
      Add('  return " style=\" background:blue; \" ";');
      Add('}');
    end;
    IWCGJQGrid1.JQGridOptions.ColModel[1].OnCellAttr.Script:= JScript.Text;
  finally
    JScript.Free;
  end;

  // 2.) Override the color of the focused row and hover row
  with ExtraHeader do
  begin
    Add('<style type="text/css">');
    Add(' .ui-jqgrid tr.jqgrow.ui-state-highlight { background: highlight !important; }');
    Add(' .ui-jqgrid tr.jqgrow.ui-state-hover { background: green !important; }');
    Add('</style>');
  end;
end;


In the following example we check if the cellvalue is 0.

Code: Select all
    with JScript do
    begin
      Clear;
      Add('function (rowId,val,rawObject,cm,rdata){');
      Add(' if (rdata.col1 != "0") {');    // == "0") {');
      Add('   return " style=\" background: LightPink \" ";');
      Add(' }');
      Add('}');
    end;


Next idea, is it possible to check if the row is selected?
If yes, we can omit the color assignment.
Then the default drawing will display it correctly.

Kind regards
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 11 Jul 2017 09:36

Hi jorgo,

There is no any ui-state-highlight class on rows...

So, you must use the follow code:

delphi code
with ExtraHeader do
begin
Add('<style type="text/css">');
Add(' .ui-jqgrid tr.jqgrow.ui-state-hover { background: green !important; }'); // SELECTED ROW
Add(' .ui-jqgrid tr.jqgrow:hover { background: red; }'); // ON ROW HOVER
Add('</style>');
end;


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by jorgo » 17 Jul 2017 11:55

Hi Alexander,

1.) thx I tested your example.
The green hovering row worked. The red row was never shown.

So I changed some parts. This new example is working at my system.
I make use of "ui-state-highlight".
(I use TIWCGJQGridCellsProvider maybe this makes the difference.)

Code: Select all
with ExtraHeader do
begin
   Add('<style type="text/css">');
   Add(' .ui-jqgrid tr.jqgrow.ui-state-hover { background: green !important; }'); // HOVER ROW
   Add(' .ui-jqgrid tr.jqgrow.ui-state-highlight { background: red !important; }'); // SELECTED ROW
   Add('</style>');
end;


2.) But I can't solve my original problem.
If I paint the cell background by myself I find no way to show the selected row in front of it.

Kind regards
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 17 Jul 2017 11:57

Hi jorgo,

Send me the simple and working testcase project.

I will help you with that.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQGrid

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.