diff options
Diffstat (limited to 'dev/jquery.jtable.core.js')
-rw-r--r-- | dev/jquery.jtable.core.js | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/dev/jquery.jtable.core.js b/dev/jquery.jtable.core.js index 5f7faac..d1542e9 100644 --- a/dev/jquery.jtable.core.js +++ b/dev/jquery.jtable.core.js @@ -95,6 +95,8 @@ _cache: null, //General purpose cache dictionary (object) + _extraFieldTypes:[], + /************************************************************************ * CONSTRUCTOR AND INITIALIZATION METHODS * *************************************************************************/ @@ -160,6 +162,7 @@ this._columnList = []; this._fieldList = []; this._cache = []; + this._extraFieldTypes = []; }, /* Fills _fieldList, _columnList arrays and sets _keyField variable. @@ -711,14 +714,12 @@ return field.display({ record: record }); } - if (field.type == 'date') { + } + else if (field.type == 'date') { return this._getDisplayTextForDateRecordField(field, fieldValue); } else if (field.type == 'checkbox') { return this._getCheckBoxTextForFieldByValue(fieldName, fieldValue); - }else if (field.type == 'record-actions') { - return this._createRecordActionsDropdown(record, field); - } - else if (field.options) { //combobox or radio button list since there are options. + } else if (field.options) { //combobox or radio button list since there are options. var options = this._getOptionsForField(fieldName, { record: record, value: fieldValue, @@ -749,13 +750,19 @@ /* Finds an option object by given value. *************************************************************************/ _findOptionByValue: function (options, value) { - for (var i = 0; i < options.length; i++) { - if (options[i].Value == value) { - return options[i]; + return this._findItemByProperty(options, 'Value', value); + }, + + /* Finds an option object by given value. + *************************************************************************/ + _findItemByProperty: function (items, key, value) { + for (var i = 0; i < items.length; i++) { + if (items[i][key] == value) { + return items[i]; } } - return {}; //no option found + return {}; //no item found }, /* Gets text for a date field. |