I have a jqGrid which needs to have radio buttons in a column of a row while editing. Following is my code:
function BindPreclosingDocs(response) {
var p
I think that you are right. There are difference in usage of custom_value
callback in different editing modes.
If form editing is used and some editable column has edittype: 'custom'
then first custom_element
function (in your case it's radioelem
function) will be called inside of $.jgrid.createEl
. Then custom_value
will be called additionally in case of rowid !== "_empty"
(not for Add form). See the lines of code for details.
The problem is that custom_element
has value
parameter. So it can set the value in the custom control and call custom_element
and additional calling of custom_value
with "set"
is not really required.
Another editing modes (inline editing and cell editing) just create custom control. The callback custom_value
will be never called with "set"
parameter.
I confirm that the documentation about custom control is too short. I suppose that you can just remove the part of your code radiovalue
for part 'set'
. I think that the following code will good work too (even in case of form editing):
function radiovalue(elem, operation, value) {
if (operation === 'get') {
return $(elem).val();
}
}
One remark: If you will try usage of custom controls you should don't forget to use recreateForm: true option. As an example of usage custom control in inline editing, form editing and searching you will find here. The reference to the demo you will find in the answer.