From 6857ab02d52975639e690a9b8827ab4cd475c213 Mon Sep 17 00:00:00 2001 From: Ryan Day Date: Fri, 28 Mar 2014 08:50:47 -0400 Subject: [PATCH] Allow users to specify a 'custom' type for a field, and run the display function for that field when adding a new record --- dev/jquery.jtable.forms.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/jquery.jtable.forms.js b/dev/jquery.jtable.forms.js index b497a7e5..2bb5d718 100644 --- a/dev/jquery.jtable.forms.js +++ b/dev/jquery.jtable.forms.js @@ -77,6 +77,13 @@ return this._createPasswordInputForField(field, fieldName, value); } else if (field.type == 'checkbox') { return this._createCheckboxForField(field, fieldName, value); + } else if (field.type == 'custom') { + if (typeof field.display === 'function') { + var $display = field.display(); + return $('
') + .addClass('jtable-input jtable-input-custom') + .append($display); + } } else if (field.options) { if (field.type == 'radiobutton') { return this._createRadioButtonListForField(field, fieldName, value, record, formType);