function DisplayForm() { $grid = new SimpleGrid(); // define heading $grid->AddHeadingRow(true); $grid->AddCell("A"); $grid->AddCell("B"); $grid->AddCell("A + B"); $grid->AddCell("A x B"); // define data for ($r = 3; $r <= 9; $r += 2) { $a = $r; $b = $r - 2; $grid->AddDataRow(); $grid->AddCell($a); $grid->AddCell($b); $grid->AddCell("<input type='text' size='3' name='p_" . $a . "_" . $b . "'>"); $grid->AddCell("<input type='text' size='3' name='t_" . $a . "_" . $b . "'>"); } echo "<div id='explanation'>This example shows how to use a SimpleGrid within a form.</div>"; echo "<p><strong>Try this simple math quiz:</strong>"; echo "<p><form method='post'>"; echo "<input type='hidden' name='action' value='calc_result'>"; echo "<input type='submit' value='Submit Answers'><p>"; $grid->Render("ex1", 2); echo "</form>"; }
<div id='explanation'> This grid was created using the <a href='../grids.html'>SimpleGrid</a> plug-in! Compare it to ex1simple.php - which is a LiveGrid. </div> <div> <button onclick="ExportGridClient('plain')">Export from client to HTML Table</button> <button onclick="ExportGridClient('owc')" id="owc">Export from client to OWC spreadsheet</button> <button onclick="ExportGridServer('xl')">Export from server to Excel</button> <button onclick="ExportGridServer('csv')">Export from server to CSV</button> </div> <?php $numcol = 15; $grid = new SimpleGrid(); $grid->AddHeadingRow(true); for ($c = 1; $c <= $numcol; $c++) { $grid->AddCell("Column {$c}"); } for ($r = 1; $r <= 100; $r++) { $grid->AddDataRow(); $grid->AddCell($r); for ($c = 2; $c <= $numcol; $c++) { $grid->AddCell("Cell {$r}:{$c}"); } } $fmt = isset($_GET["fmt"]) ? $_GET["fmt"] : ""; switch (strtolower($fmt)) { case "xl": $grid->RenderExcel("rico.xls"); break;
// filterUI='t' --> text box // filterUI='s' --> select list var grid_options = { useUnformattedColWidth: false, FilterLocation: -1, // put filter on a new header row columnSpecs: [,,{filterUI:'t',width:150}, {filterUI:'t',width:100}, {filterUI:'s',width:100}, {type:'date',width:90}, {type:'date',width:90}] }; </pre> </div> <p><button onclick='ex3.printVisible()'>Export</button> <?php $grid = new SimpleGrid(); $grid->AddHeadingRow(false); $grid->AddCell("ID"); $grid->AddCell("ID"); $grid->AddCell("Shipment"); $grid->SetCellAttr("colspan", 3); $grid->AddCell("Date"); $grid->SetCellAttr("colspan", 2); $grid->AddHeadingRow(true); $grid->AddCell("Order"); $grid->AddCell("Customer"); $grid->AddCell("Name"); $grid->AddCell("City"); $grid->AddCell("Country"); $grid->AddCell("Order"); $grid->AddCell("Ship"); if (OpenDB()) {