예제 #1
0
// enable inline editing
$dg->enable_edit("FORM", "CRUD");
$dg->set_form_dimension(1200, 700);
// set export type
$dg->enable_export('EXCEL');
// $dg -> enable_export('CSV');
// Page Size
$dg->set_pagesize(15);
$dg->enable_resize(true);
// $dg -> enable_autowidth(true);
$dg->enable_autoheight(true);
// $dg -> set_scroll(true);
$dg->enable_kb_nav(true);
// beta.  be careful
// Set grid colors & theme
$dg->set_theme('cobalt');
// $dg -> set_row_color('#BDE7F2', 'lightblue', '#DDE8F5');
// always the last line in the grid section.
$dg->display();
?>

<script type="text/javascript">
    $(function() {
        var grid = jQuery("#formstack");
        grid[0].toggleToolbar();
    });
</script>

<style>
    /* resize displayed images */
    .ui-jqgrid tr.jqgrow td img{
예제 #2
0
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
/**
 * Special route for using PHP Data Grid to display "dashboard" list of users.
 * See http://www.codeproject.com/Articles/1006057/phpGrid-Laravel-and-Bootstrap for details.
 */
Route::get('dashboard', function () {
    require_once public_path() . '/assets/plugins/phpGrid_Lite/conf.php';
    $dg = new C_DataGrid("SELECT * FROM users", "id", "users");
    $dg->enable_edit("INLINE", "CRUD");
    $dg->enable_autowidth(true)->enable_autoheight(true);
    $dg->set_theme('cobalt-flat');
    $dg->display(false);
    $grid = $dg->get_display(true);
    return view('dashboard', array('grid' => $grid));
});
// Provide controller methods with model object instance instead of ID
// by using route-model binding
Route::model('projects', 'Project');
Route::model('tasks', 'Task');
Route::model('users', 'User');
Route::bind('projects', function ($value, $route) {
    return App\Project::whereSlug($value)->first();
});
Route::bind('tasks', function ($value, $route) {
    return App\Task::whereSlug($value)->first();
});