コード例 #1
0
ファイル: formstackdb.php プロジェクト: wtsmith/ODLScripts
$dg->set_col_edittype("FormstackImage1", "disabled");
$dg->set_col_edittype("FormstackImage2", "disabled");
$dg->set_col_edittype("FormstackImage3", "disabled");
$dg->set_col_edittype("FormstackImage4", "disabled");
$dg->set_col_edittype("FormstackImage5", "disabled");
$dg->set_col_edittype("FormstackImage6", "disabled");
$dg->set_col_edittype("FormstackImage7", "disabled");
$dg->set_col_edittype("FormstackImage8", "disabled");
$dg->set_col_edittype("BeforeAfter1", "disabled");
$dg->set_col_edittype("BeforeAfter2", "disabled");
$dg->set_col_edittype("BeforeAfter3", "disabled");
$dg->set_col_edittype("BeforeAfter4", "disabled");
$dg->set_col_edittype("Comments", "textarea");
$dg->set_col_edittype("Comments2", "textarea");
// Set image fields to read only.
$dg->set_col_readonly("pk, FormstackImage1, FormstackImage2, FormstackImage3, FormstackImage4");
// Set data edit form layout and dimensions
$dg->set_col_property("pk", array("formoptions" => array("rowpos" => 1, "colpos" => 1)));
$dg->set_col_property("OrderNumber", array("formoptions" => array("rowpos" => 1, "colpos" => 2)));
$dg->set_col_property("DateTime", array("formoptions" => array("rowpos" => 1, "colpos" => 3)));
$dg->set_col_property("FirstName", array("formoptions" => array("rowpos" => 2, "colpos" => 1)));
$dg->set_col_property("LastName", array("formoptions" => array("rowpos" => 2, "colpos" => 2)));
$dg->set_col_property("email", array("formoptions" => array("rowpos" => 2, "colpos" => 3)));
$dg->set_col_property("Address1", array("formoptions" => array("rowpos" => 3, "colpos" => 1)));
$dg->set_col_property("Address2", array("formoptions" => array("rowpos" => 3, "colpos" => 2)));
$dg->set_col_property("AddressCity", array("formoptions" => array("rowpos" => 4, "colpos" => 1)));
$dg->set_col_property("AddressState", array("formoptions" => array("rowpos" => 4, "colpos" => 2)));
$dg->set_col_property("AddressZip", array("formoptions" => array("rowpos" => 4, "colpos" => 3)));
$dg->set_col_property("Country", array("formoptions" => array("rowpos" => 4, "colpos" => 4)));
$dg->set_col_property("InstallerRating", array("formoptions" => array("rowpos" => 5, "colpos" => 1)));
$dg->set_col_property("DoorConstruction", array("formoptions" => array("rowpos" => 5, "colpos" => 2)));
コード例 #2
0
<script type="text/javascript">
    function ShowSelectedRows(){
        var rows = getSelRows();
        alert(rows);
    }
</script>
</head>
<body> 

<?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");
// enable edit
$dg->enable_edit("INLINE", "CRUD");
// read only columns, one or more columns delimited by comma
$dg->set_col_readonly("orderDate, customerNumber");
// required fields
$dg->set_col_required("orderNumber, customerNumber");
// multiple select
$dg->set_multiselect(true);
$dg->display();
?>
<input type="button" id="bSelRow" value="Get Selected Rows" onclick="ShowSelectedRows()">
</body>
</html>
コード例 #3
0
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Integrated Search</title>
</head>
<body> 

<?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);
$dg->enable_edit('FORM', 'CRUD');
$dg->set_col_edittype('status', 'select', 'Open:Open;Shipped:Shipped;Cancelled:Cancelled;Disputed:Disputed;On Hold:On Hold');
$dg->set_col_readonly("orderNumber");
$dg->enable_kb_nav(true);
$dg->display();
?>

</body>
</html>