Create Excel-Like Grid

Use enable_autowidth() and enable_autoheight() to set datagrid width as the same as the current page dimension to fill the entire screen, similar to what Excel spreadsheet looks like.

1
2
3
4
$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
$dg->enable_edit('FORM', 'CRUD');
$dg->enable_autowidth(true)->enable_autoheight(true);
$dg -> display();

See Live Example!

Hint:
Call enable_kb_nav() method to move between rows using only keyboard.

No related content found.

Tags: , , ,