Forum
09:11
11/03/2010
In form eidt mode, there is an beforeCheckValues event. but I thinks an afterCheckValues event is needed.
because the default jqgrid checkvalue behavior is not very good. It show the error info on the top of the edit form, but don't make an obviously mark on which field is on error. So the user need to read the error info, and to FIND the corresponding field by himself. If there is a lot of field on the edit form, it's a hard work.
So I need the afterCheckValues event to return which field is on error, and I could code in this event to hightlight the field as I wish, just like mark the field's div as a red border.. etc.
Or I have exsiting way to do this?
yours,
Ivan
13:43
10/08/2009
Hello Ivan,
I agree with you that it is a problem.
Look at the demo which I wrote for the answer. It shows how you can overwrite the standard $.jgrid.checkValues function and do some additional actions. The example uses inline editing, but you can easy modify it for the form editing.
I can add that one more important problem is that the field validating will be broken at the first error found. If one mark the fields having errors one can validate all fields. In dialog haveing many field it can improve the user expirience.
As the workaround I could suggest you to use beforeSubmit event. If you would returns from your version of $.jgrid.checkValues allways true, but set some error flag (varible), you can test the flag in your beforeSubmit event handler and returns the resulting [false, "your error message"]. Additionally you can add "ui-state-error" class to all field where the validation failed. Additionally you can set tooltips to the <input> elements which has validation errors, so that the tooltips describe the error exactly. You can choose different style of displaying of tooltips (see here and here for example)
I hope that Tony will improve the standard behavior on the field checking.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
55 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66