Since v1.7.3
After enable this feature in the grid, a form will be added to the table header to create the data. For some simple form pages, it is convenient to quickly create data without jumping to the create page.
To enable quick create:
$grid->quickCreate(function (Grid\Tools\QuickCreate $create) {
$create->text('name', 'Name');
$create->email('email', 'Email');
});
Note:Each field in the form, and the same type of form field should be set on the create form page.
The form fields supported by the form have the following types
$create->text('column_name', 'placeholder...');
$create->email('column_name', 'placeholder...');
$create->ip('column_name', 'placeholder...');
$create->url('column_name', 'placeholder...');
$create->password('column_name', 'placeholder...');
$create->mobile('column_name', 'placeholder...');
$create->integer('column_name', 'placeholder...');
$create->select('column_name', 'placeholder...')->options([
1 => 'foo',
2 => 'bar',
]);
$create->multipleSelect('column_name', 'placeholder...')->options([
1 => 'foo',
2 => 'bar',
]);
Time and date input box
$create->datetime('column_name', 'placeholder...');
Time input box
$create->time('column_name', 'placeholder...');
$create->date('column_name', 'placeholder...');