Forum
06:46
I think it will be very easy and not too hard to implement input validation by passing a string to use as a regexp. For example, a colmodel could be like:
...
colModel:{
editrules:{
regexpPattern: '^[xy0-9]\\d{7}[a-z]$',
regexpFlags: 'i',
regexpMessage: 'The value must be X or Y followed by 7 numbers and a letter, or 8 numbers and a letter'
}
}
This will work for a spanish ID, for example.
This is approximately the function you should put at the end of any other validations:
¿What do you think of the idea?
11:15
Moderators
30/10/2007
Hello,
No need to to do it so complex. Also the 3.6 version offers a custom validation where you can do it simple like this:
colModel: [
...
{ name :'some',..., editrules : {custom:true, custom_func: myfunc ... },
..
]
Where myfunc should return true or false depending on your need. See the 3.6 demos
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
06:57
I saw it, but i'm sending automatically-generated json data from a PHP class to generate the grids, and the json parser can't send functions, so it would be more helpful for me the regexp option because it's only string-based.
Anyway, it's just an idea, if you think it's unnecessary, I can implement it by myself.
Thanks for all!
Most Users Ever Online: 715
Currently Online:
57 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