dimension Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Tue, 03 Dec 2024 18:24:57 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 set_col_edit_dimension() https://phpgrid.com/documentation/set_col_edit_dimension/ Sat, 14 Jul 2012 06:09:08 +0000 http://phpgrid.com/?p=2158 Parameters: $col_name: column name $size/$cols: If the column is a text box, it’s the size that represents number of characters. If the column is a textarea, it’s the value for cols attribute in textarea. $rows: Optional. Number of rows in a textarea Description:  Set input text box size or textarea cols and rows values in edit […]

The post set_col_edit_dimension() appeared first on phpGrid - PHP Datagrid.

]]>
  • Parameters:
    • $col_name: column name
    • $size/$cols: If the column is a text box, it’s the size that represents number of characters. If the column is a textarea, it’s the value for cols attribute in textarea.
    • $rows: Optional. Number of rows in a textarea
  • Description:
    •  Set input text box size or textarea cols and rows values in edit form.
  • Remark:
  • Example:
  • 1
    2
    3
    4
    5
    // status is a text fields, 40 indicates the text field is 40 characters long.
    $dg -> set_col_edit_dimension("status", 40);

    // comments, a text data type, is rendered as textarea with cols set to 50, rows set to 10
    $dg -> set_col_edit_dimension("comments", 50, 10);

    The post set_col_edit_dimension() appeared first on phpGrid - PHP Datagrid.

    ]]>
    2158
    set_form_dimension() https://phpgrid.com/documentation/set_form_dimension/ Sat, 14 Jan 2012 19:54:18 +0000 http://phpgrid.com/?p=1865 Parameters: $f_width: form width. The default value is ‘400px’ $f_height: form height. The default is -1 so it is automatically adjusted to number of rows. Description: Set edit FORM width and height during edit. Remark: The default $f_height value is -1 (negative one) so it is automatically adjusted to number of rows. The function only can apply […]

    The post set_form_dimension() appeared first on phpGrid - PHP Datagrid.

    ]]>
  • Parameters:
    • $f_width: form width. The default value is ‘400px’
    • $f_height: form height. The default is -1 so it is automatically adjusted to number of rows.
  • Description:
    • Set edit FORM width and height during edit.
  • Remark:
    • The default $f_height value is -1 (negative one) so it is automatically adjusted to number of rows.
    • The function only can apply to non-bootstrap themes such as ‘aristo’ or ‘cobalt’. For Bootstrap themes, it has no effect as the layout is managed by the Bootstrap framework.
  • Example:
  • 1
    $dg->set_form_dimension('500px');
    The function only can apply to non-bootstrap themes such as ‘aristo’ or ‘cobalt’. For Bootstrap themes, it has no effect as the layout is managed by the Bootstrap framework.
    X

    The post set_form_dimension() appeared first on phpGrid - PHP Datagrid.

    ]]>
    1865
    Set Grid Height and Width https://phpgrid.com/example/set-height-and-width/ Thu, 16 Sep 2010 00:22:12 +0000 http://64.38.236.7/?p=507 Use set_dimension() method to specify grid initial height and width. The default height and width is 400 by 300 pixels. In this example, the width is set to 800 pixel, and height is set to 600 pixel. Wait, It looks funny! The grid height is taller than the space used by the number of rows […]

    The post Set Grid Height and Width appeared first on phpGrid - PHP Datagrid.

    ]]>
    Use set_dimension() method to specify grid initial height and width. The default height and width is 400 by 300 pixels. In this example, the width is set to 800 pixel, and height is set to 600 pixel.

    Wait, It looks funny! The grid height is taller than the space used by the number of rows in a page. To fix this, we can set bigger pagination to accommodate a taller grid. See the next example on pagination.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    // Always include namespace and conf.php on TOP of the script.
    use phpCtrl\C_DataGrid;
    require_once("/file/path/to/conf.php");  

    $dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");

    // change column titles
    $dg->set_col_title("orderNumber", "Order No.");
    $dg->set_col_title("orderDate", "Order Date");
    $dg->set_col_title("shippedDate", "Shipped Date");
    $dg->set_col_title("customerNumber", "Customer No.");
     
    // hide a column
    $dg -> set_col_hidden("requiredDate");

    // change default caption
    $dg -> set_caption("Orders List");

    // set export type
    $dg -> enable_export('EXCEL');

    // enable integrated search
    $dg -> enable_search(true);

    // set height and weight of grid
    $dg -> set_dimension(800, 600);
     
    $dg -> display();

    See Live Example!

    The post Set Grid Height and Width appeared first on phpGrid - PHP Datagrid.

    ]]>
    507
    set_dimension() https://phpgrid.com/documentation/set_dimension/ Wed, 15 Sep 2010 19:12:25 +0000 http://64.38.236.7/?p=444 Parameter(s): $width: Datagrid width $height: Datagrid height. The default is 100% which expanses grid vertically to the entire browser height  $shrinkToFit: true or false. If set to false, horizontal bar will appear when the total width of grid is wider than the dimesion width. The default is true. Description: Set the overall height and width […]

    The post set_dimension() appeared first on phpGrid - PHP Datagrid.

    ]]>
  • Parameter(s):
    • $width: Datagrid width
    • $height: Datagrid height. The default is 100% which expanses grid vertically to the entire browser height
    •  $shrinkToFit: true or false. If set to false, horizontal bar will appear when the total width of grid is wider than the dimesion width. The default is true.
  • Description:
    • Set the overall height and width of phpGrid
  • Remark:
    • It is recommended to set $shrinkToFit to false when there are a large number of columns to display.
  • Example:
  • 1
    $dg -> set_dimension(800, 600);

    The post set_dimension() appeared first on phpGrid - PHP Datagrid.

    ]]>
    444