-
Notifications
You must be signed in to change notification settings - Fork 13
Tabular Steps: Limiting Rows
Coackroach edited this page May 15, 2019
·
1 revision
When working with Tabular steps you may want to restrict the user depending on the requirements to add specific number of rows, and not any more than that. Like for example they can choose to add 3 referrals who will be sent a discount code when the user signs up or can redeem 3 coupons when using the formwizard as a shopping cart to checkout.
You can use the limitRows
option inside the main options for the step in combination with the STEP_TYPE_TABULAR
for instance see below example
echo FormWizard::widget([
'steps' => [
[
'title'=>'Redeem Coupons'
'model' => new Coupons(),
'type' => FormWizard::STEP_TYPE_TABULAR,
'limitRows' => 4,
],
]
]);
When in edit mode it will not populate more than 4 rows from the model. If you wont specify the limitRows
option, you can add as many as you want and they will be loaded in edit mode vice versa.
- Get Running with Minimal Options
- Disable ActiveForm Validation
- Enable Ajax Validation
- Add Custom Buttons
- Widget Constants
- Customizing Form Fields
- Configuring File Uploads
- Custom Field Order
- Single Model Across Steps
- Multiple models in a single step
-
Tabular Steps-(New)
- Working With Widgets
- Limiting Rows
- Dependent Inputs Since v1.7.2
- Skip-able Step-(Since v1.5.0)
- Enable Preview Step-(New)
- Group Fields-(New)
- Enable Form Persistence-(New)
- Enable Edit Mode - (Since v1.6.4)