tags:

views:

645

answers:

1

hi,

im currently working on jqgrid using ci framework. just want to ask about the validation in jqgrid. I've seen that in jqgrid a column can be validated like this: editrules: {required:true}}, and so on...

heres my question, i want to know if its possible that if a client enters his/her desired username but it already exist. Is this possible using the jqgrid validations?

thanks -Dean

+1  A: 

You can do this using a custom edit rule

This is the example in the documentation

function mypricecheck(value, colname) {
if (value < 0 && value >20) 
   return [false,"Please enter value between 0 and 20"];
else 
   return [true,""];
}
jQuery("#grid_id").jqGrid({
...
   colModel: [ 
      ... 
      {name:'price', ..., editrules:{custom:true, custom_func:mypricecheck....}, editable:true },
      ...
   ]
...
});
Rigobert Song