CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Erratic behavior with alignment "alClient"

by GibaCps43 » 13 Jun 2015 17:55

I'm trying to create an application where the user selects an option from the menu and the form (frame) requested is displayed in a new tab of a tabcontrol in the main form.

All components are aligned as "alClient". The forms (frames) created at runtime have a component layout with a central panel (with a grid occupying its total area) and a right pane where the details of the selected record will be displayed. When this form is initially displayed, the grid is not shown occupying the area of ​​the central panel. When the details pane is open, the grid occupies the area as planned. Closing the details pane the grid occupies the area initially defined in the project and even opening and closing the details pane again it does not return to occupy the total area available.

Similar behavior is noticed when navigating between tabs (alignment is not obeyed).

How to solve this?

I am attaching a test project (without the wwwroot content) showing this behavior.

One last detail: i'd like when the grid was expanded its cells keep the size defined in the project and not expanded to fill the whole grid length. It's possible?

Thanks for listening


Em Português:

Estou tentando criar uma aplicação onde o usuário seleciona uma opção no menu e o formulário (frame) solicitado é exibido em uma nova aba de um tabcontrol no formulário principal.

Todos os components estão alinhados como "alClient". Os formulários (frames) criados em tempo de execução possuem um component layout com um painel central (com um grid ocupando sua área total) e um painel direito onde serão exibidos os detalhes do registro selecionado. Quando este formulário é exibido inicialmente, o grid não é mostrado ocupando a área do painel central. Quando o painel de detalhes é aberto, o grid ocupa a área como previsto. Ao fechar o painel de detalhes o grid volta a ocupar a área definida inicialmente no projeto e, mesmo abrindo e fechando o painel de detalhes novamente ele não volta a ocupar a área total disponível.

Comportamento semelhante é notado quando se navega entre as abas (o alinhamento não é obedecido).

Como resolver isto?

Estou anexando um projeto teste (sem o conteúdo do wwwroot) mostrando este comportamento.

Um último detalhe: gostaria que quando o grid fosse expandido as células continuassem com o tamanho definido no projeto e não fossem expandidas para ocupar toda o comprimento do grid. É possível?

Obrigado pela atenção
You do not have the required permissions to view the files attached to this post.
GibaCps43
 
Posts: 5
Joined: 13 Jun 2015 15:31

by Alexander Bulei » 15 Jun 2015 14:31

Hi GibaCps43,

We have added new property AjaxLoadCallBrowserResize (default: False) for the next build.
Since the next build, you will need activate that property in tab.

Also, you have missing the align of frame, add this line:

delphi code
myframe.Align:= alClient;


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 GibaCps43 » 15 Jun 2015 17:48

Alexander Bulei wrote:Hi GibaCps43,

We have added new property AjaxLoadCallBrowserResize (default: False) for the next build.
Since the next build, you will need activate that property in tab.


How can I do this?

Other:

Is there any way to keep the original width of the columns when the grid is expanded?
GibaCps43
 
Posts: 5
Joined: 13 Jun 2015 15:31

by Jorge Sousa » 15 Jun 2015 18:53

Hello

How can I do this?


Wait for the new release, and set then

new property AjaxLoadCallBrowserResize


to True. Is that ok with you?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by GibaCps43 » 15 Jun 2015 19:07

Jorge Sousa wrote:Hello

How can I do this?


Wait for the new release, and set then

new property AjaxLoadCallBrowserResize


to True. Is that ok with you?



OK for me.

What about the size of columns? Is there any way to keep them with the size defined after the grid be expanded?


Thank you
GibaCps43
 
Posts: 5
Joined: 13 Jun 2015 15:31

by Alexander Bulei » 16 Jun 2015 09:56

Hi GibaCps43,

Please use our documentation and JQGrid section in our forum, to find the answers & examples.

Documentation: http://www.cgdevtools.com/docs/_html/IWCGJQGrid.htm
JQGrid section: http://www.cgdevtools.com/cgforum/viewforum.php?f=34

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 GibaCps43 » 17 Jun 2015 12:59

Alexander Bulei wrote:Hi GibaCps43,

Please use our documentation and JQGrid section in our forum, to find the answers & examples.

Documentation: http://www.cgdevtools.com/docs/_html/IWCGJQGrid.htm
JQGrid section: http://www.cgdevtools.com/cgforum/viewforum.php?f=34

Best Regards.


Hi Alexander

I tried to find something in the grid documentation but honestly this documentation is only a couple "topic = null Explanation". I do not think anyone can get anywhere from there.

I visited the forum link you provided and then includes the following lines:

Code: Select all
   Grid.JQGridOptions.ColModel [0] .OnCellAttr.Script: = 'function (rowId, val, rawObject, cm, rdata) {return "width = 150px;"}';
   Grid.JQGridOptions.ColModel [1] .OnCellAttr.Script: = 'function (rowId, val, rawObject, cm, rdata) {return "width = 300px;"}';
   Grid.JQGridOptions.ColModel [2] .OnCellAttr.Script: = 'function (rowId, val, rawObject, cm, rdata) {return "width = 50px;"}';


in several events within the frame unit but got no success.

Can you help me?

Best regards.
GibaCps43
 
Posts: 5
Joined: 13 Jun 2015 15:31

by Jorge Sousa » 17 Jun 2015 14:17

Hello

I think you only have to set Grid.JQGridOptions.ShrinkToFit := False

If I undertand correctly what you mean by Expanded.

http://www.cgdevtools.com/docs/_html/IWCGJQGrid.TIWCGJQGridOptions.ShrinkToFit.htm

If you want to save the columns width, upon user adjustment, set Grid.JQGridPersist.Enabled:= True and the Column Widths will be saved as cookies.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by GibaCps43 » 17 Jun 2015 18:18

Hi Jorge

The problem was with Grid.JQGridOptions.ShrinkToFit. It was setted with True (default).


Thank you
GibaCps43
 
Posts: 5
Joined: 13 Jun 2015 15:31


Return to JQLayout

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.