Datagrid properties Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Fri, 29 Nov 2024 23:51:13 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 Interactive Datagrid Resizing https://phpgrid.com/example/resize-datagrid-with-the-mouse/ Thu, 16 Sep 2010 23:53:12 +0000 http://64.38.236.7/?p=532 When enabled, the small triangle icon is displayed at the right bottom corner of the grid. The php grids can be resized by simply click and drag the icon using mouse. This is more convenient than setting the width and height in the code. 123456789101112131415161718192021222324252627282930313233343536// Always include namespace and conf.php on TOP of the script. […]

The post Interactive Datagrid Resizing appeared first on phpGrid - PHP Datagrid.

]]>
When enabled, the small triangle icon is displayed at the right bottom corner of the grid. The php grids can be resized by simply click and drag the icon using mouse. This is more convenient than setting the width and height in the code.

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
29
30
31
32
33
34
35
36
// 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 products", "productCode", "productCode");
$dg ->set_col_title("productCode", "Product Code");
$dg ->set_col_title("productName", "Product Name");
$dg ->set_col_title("productLine", "Product Line");

// display static Url
$dg ->set_col_link("productUrl");                                            

// dynamic url. e.g.http://www.example.com/?productCode=101&foo=bar
$dg -> set_col_dynalink("productCode", "http://www.example.com/", "productCode", '&foo=bar');

// column format
$dg -> set_col_currency("buyPrice");
$dg -> set_col_format("quantityInStock", "integer", array("thousandsSeparator" => ",",
                                                          "defaultValue" => "0"));  
$dg -> set_col_format("MSRP", 'currency', array("prefix" => "$",
                                                "suffix" => '',
                                                "thousandsSeparator" => ",",
                                                "decimalSeparator" => ".",
                                                "decimalPlaces" => '2',
                                                "defaultValue" => '0.00'));

// the above line is equivalent to the following helper function                        
$dg -> set_col_currency("MSRP", "$", '', ",",".", "2", "0.00");                                      

// display image
$dg -> set_col_img("Image");

// enable resize by dragging mouse
$dg -> enable_resize(true);
                                                 
$dg -> display();

See Live Example!

The post Interactive Datagrid Resizing appeared first on phpGrid - PHP Datagrid.

]]>
532
Datagrid Pagination https://phpgrid.com/example/set-pagination/ Thu, 16 Sep 2010 00:24:36 +0000 http://64.38.236.7/?p=510 By default, the pagination size is 20. It means maximum of 20 records can be displayed in a page. This value can be easily changed with set_pagesize() method. Be aware that pagination is disabled when set_scroll() is set to true. See the next example on set_scroll() for more information. 12345678910111213141516171819202122232425262728293031// Always include namespace and conf.php […]

The post Datagrid Pagination appeared first on phpGrid - PHP Datagrid.

]]>
By default, the pagination size is 20. It means maximum of 20 records can be displayed in a page. This value can be easily changed with set_pagesize() method. Be aware that pagination is disabled when set_scroll() is set to true. See the next example on set_scroll() for more information.

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
29
30
31
// 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 datagrid
$dg -> set_dimension(800, 600);

// increase pagination size to 40 from default 20
$dg -> set_pagesize(40);
 
$dg -> display();

See Live Example!

The post Datagrid Pagination appeared first on phpGrid - PHP Datagrid.

]]>
510
Datagrid Caption https://phpgrid.com/example/datagrid-caption/ Thu, 16 Sep 2010 00:16:04 +0000 http://64.38.236.7/?p=501 By default, phpGrid displays table name as the caption. You can change the datagrid caption using set_caption(). You can also hide the caption by using an empty string “” as the caption. 12345678910111213141516171819// 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", […]

The post Datagrid Caption appeared first on phpGrid - PHP Datagrid.

]]>
By default, phpGrid displays table name as the caption. You can change the datagrid caption using set_caption(). You can also hide the caption by using an empty string “” as the caption.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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");
 
$dg -> display();

See Live Example!

The post Datagrid Caption appeared first on phpGrid - PHP Datagrid.

]]>
501