APYDataGridBundle icon indicating copy to clipboard operation
APYDataGridBundle copied to clipboard

Validating data

Open patie opened this issue 13 years ago • 6 comments
trafficstars

Its possible to check values from inputs before getting new data ? It may not be strictly a true validation, maybe just values from inputs before render new data

It would be nice :-) What do you think?

patie avatar Oct 15 '12 21:10 patie

Column classes have the isQueryValid() method to control the input value before filtering. If this function return false, the value is ignored.

Do you mean this type of validation ?

Abhoryo avatar Oct 16 '12 11:10 Abhoryo

im not sure, i need for example check string long (value long for some row filter), its possible with this ?

patie avatar Oct 16 '12 11:10 patie

string long

You mean string length or long integer ?

Abhoryo avatar Oct 16 '12 12:10 Abhoryo

length of course, sorry

patie avatar Oct 16 '12 14:10 patie

You can create a new column class with the isQueryValid() method override where you test your string length. And don't forget to declare your new column in config.

Maybe we can add the possibility to add filter validator for a column.

Abhoryo avatar Oct 16 '12 14:10 Abhoryo

If we use the Symfony Form component for manage filters (#797), we could use the Symfony Validator component for validate the filters data.

qferr avatar Dec 22 '15 00:12 qferr