-
Notifications
You must be signed in to change notification settings - Fork 13
Tabular Steps (New Feature)
A new feature for tabular steps has been added which will help you to configure address book like features into the formwizard, there have been several queries related to such feature where we need to add multiple addresses against a single user or add multiple tags against any album and we need to be able to have a Add New button which should dynamically add the set of inputs as needed you can use the type
property in the step array, it defaults to default
. See the details below under options.
After the addition of the feature Tabular Steps when using 'type'=>'tabular'
you must remember that you cannot provide different models, although you can provide multiple instances when in edit mode but for the same model only.
New Constants added are
const STEP_TYPE_DEFAULT='default';
const STEP_TYPE_TABULAR='tabular';
While adding a new record you can have like below
$addressModel = new Address();
"steps"=>[
[
'title'=>'Step Title',
'type' => FormWizard::STEP_TYPE_TABULAR,
'model'=> $addressModel
]
]
When in Edit Mode you can provide the multiple instances of Address
//either using model directly
$addressModel = Address::find()
->where(
['=','user_id',Yii::$app->user->id]
)->all();
//or using the model relation if you have `getAddress()` defined inside
//the `User` model. `$user` has the selected user in code below
$addressModel = $user->address;
"steps"=>[
[
'title'=>'Step Title',
'type' => FormWizard::STEP_TYPE_TABULAR,
'model'=> $addressModel
]
]
- 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)