loyola
loyola

Reputation: 4062

Do we need to validate the input in jqgrid?

Does jqgrid has inbuilt validation? or Do we need to validate each and every values when user trying to do manipulating data.

Thanks,

Upvotes: 0

Views: 276

Answers (1)

Oleg
Oleg

Reputation: 221997

One can define editrules in colModel for validations. One can use custom: true property and custom_func callback for validation. The validation will be done before saving modified data.

One more possibility is the usage of plugins which you can initialize in dataInit callback (see the old answer as an example) of to register change event handler inside of dataEvents. It could allows to make validation before starting saving the data.

There are some other additional possibilities which are specific for editing mode. Form editing for example supports beforeCheckValues callback and jqGridAddEditBeforeCheckValues event which will be triggered before individual validation of editing fields and beforeSubmit callback and jqGridAddEditBeforeSubmit event allows to make additional final validation.

So you should just examine which possibilities more corresponds to your requirements.

Upvotes: 1

Related Questions