Toggle menu
876
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Expression of dynamic resizing: Difference between revisions

From Catglobe Wiki
No edit summary
 
Line 27: Line 27:
  function adjustHeight3(grid)
  function adjustHeight3(grid)
  {
  {
  return (document.body.clientHeight - grid.MainGrid.clientTop);
  return (document.body.clientHeight - grid.MainGrid.offsetTop);
  }</source>
  }</source>



Latest revision as of 03:37, 27 May 2009

As you know that we have rejected the IE emulation which makes IE DHTML Object Model work in FireFox. There are so many things to change and I hereby inform you a new way of resizing control height dynamically

Currently, there are two kinds of control which get involved in this issue, standard HTML element and CGGrid especially. In former code, we used setExpression method of control style object to handle resizing but it is not used any more. I have extended two methods with the same name as setHeightExpression, one for standard HTML and one for CGGrid ( because it has more works around )

PROTOTYPE

setHeightExpression( function delegate )

function delegate will take care of calculation which returns a numeric value for control height and it has a prototype as below

function resizeDelegate(control)

It is recommended that the function delegate should return a numeric value but you can do nothing like that; you can manipulate control height inside the delegate instead.

The parameter control could be the standard HTML element or grid control.

EXAMPLES

For grid control

function step3grid_InitializeLayoutHandler(gn)
 {
 var grid = igtbl_getGridById(gn);
 grid.setHeightExpression(adjustHeight3);
 }

 function adjustHeight3(grid)
 {
 return (document.body.clientHeight - grid.MainGrid.offsetTop);
 }

For standard HTML element

The method is extended to jQuery library

$(proccessTextbox).setHeightExpression(AdjustHeigh);

 function AdjustHeigh(element)
 {
 return document.body.clientHeight - element.offsetTop;
 }