How we can create Material UI Switch Group component with yup and formik - formik

There is no support for SwitchGroup as there is for RadioGroup from Material UI, I am trying to create SwitchGroup to show an error in formik form through yup. But how can we achieve that?
from what I get to understand from this article switch group can be created but how can we add validation to it from yup/ formik?
code sandbox link from the form:
https://codesandbox.io/s/blissful-haze-qiymy?from-embed

Related

Filterable: true is not available in angular version of Kendo UI Pivot Grid

I'm trying to add filters to the pivot grid as below. Please help me to implement filter option as below by using Kendo UI Angular.
This is the code I'm using for pivot grid and don't know where to add the property to enable the filter.
<kendo-pivotgrid [kendoPivotLocalBinding]="timingTableData" [dimensions]="dimensions" [measures]="measures"
[rowAxes]="rows" [columnAxes]="columns" [measureAxes]="defaultMeasureAxes">
</kendo-pivotgrid>
enter image description here
I'm trying to add filters for kendo UI pivot grid in angular 14.
You will need to define the filter property and provide a FilterDescriptor for the filtering to work. For more details you can refer to our documentation:
https://www.telerik.com/kendo-angular-ui/components/pivotgrid/filtering/
Setting the filter property to true isn't a valid option in the case of the PivotGrid, but other components like the Grid will work.

Vuetify - dynamically create a form with v-text-fields + CRUD - v-model issue

in a Vuetify project I would like to dynamically create all the required fields to perform CRUD Actions:
I prepared a working sample here:
https://codepen.io/jslab-it/pen/KKqyBdX
Everything's working not bad, but when I click on the edit button, the dialog appears but fields are not populated:
I assume that problem is that v-model is "calculated":
:v-model="'editedItem.'+f.name"
in fact in the last field that is not generated but hardcoded and thus has
v-model="editedItem.calories"
the field is automatically populated.
I tried also using a computer property for editedItem, but without success
Can suggest if it is possible and the right path?
Thanks
You can use editedItem[f.name], which is a standard way to access dynamic property in js.

Conditional Aurelia Validation on Visibility of Element

I'm trying to work out some license subscription form with aurelia and aurelia validation plugin.
I have a fieldset for personal information where most of them are required and get validated by aurelia validation.
Now I also have a fieldset for credit card information and for billing address with also fields that are required and validated. The thing is, they only get displayed when the user picks the subscription radio button.
I have all the required fields in the ValidationRules, how can I tell aurelia that it should only validate the ones that are currently visible?
You can use conditional validation with the when fluent method. Here is an example from the Aurelia Docs.
ValidationRules
.ensure('email')
.email()
.required()
.when(order => order.shipmentNotifications)
.withMessage('Email is required when shipment notifications have been requested.');
If you use if.bind on your element, the hidden element will not get validated.
Unless you want the element in your DOM but only hidden, use if.bind.
That way, your element is not rendered in dom, so not validated.
show.bind -> hide/show element
if.bind -> render/not render element

extjs 4 dynamic radio group with xtype in sencha architect

How can I create a component in sencha architect (or outside from architect), what has a custom xtype (user alias), and can be placed in a formpanel in architect.
The method is when the containing formpanel is created whith the given xtype then the component makes a ajax query, which gives back the radio buttons names, and configs, and the component show the correct buttons/names on the form panel.
thank you!
firstly you when you Ext.define() to extend a class you can specify an 'alias' in all lowercase using the format:
alias: 'widget.myxtype'
can you provide more detail regarding what you need to load into your form.
It sounds like you are looking to define a radiobuttongroup and have items dynamically loaded?
if so you could just load the form and have a fake form item (an array of 'radio button configs) that you load. Then you would extend the radio button group class insert items using .add() as child items as you would any other class

Integrating Ext.grid.panel validation and Ext.data.Model.validations

I've been learning ExtJS4 after having done quite a bit of dev in ExtJS3. I'm quite intrigued by the new class Ext.data.Models, but I would love to integrate these validations with the validation function in Ext.grid.Panel.
Can anyone point me in the direction of any examples of using the validations property of Ext.data.Model in a Grid panel?
I've tried adding the validations to the model and putting invalid values in the grid, but it doesn't seem to throw an errors or the normal red lines.
Any ideas?
Model validation against grid data is not supported out of the box currently.
Here is a working extension for model validation against form fields though.
And here is an incomplete attempt for model validation against a grid (what you were going for).
#Drew
The grid provides RowEditing and CellEditing plugins for row/cell editing. In the background these plugins use Form panel for the validation of the input. So, you can use the form panel extension that #Geronimo has mentioned along with the extensions of RowEditing and CellEditing classes and use them in your grid to validate the data entered in the grid against the model associated with the row. And since, the validate() method is on a model, which can be used to validate a complete row data or a particular cell data. In case you are looking for bulk validation, you can override the sync() method of the Ext.data.Store class to achieve that.

Resources