From 29bde818a31103aba7391ab2d331fc179fb39e70 Mon Sep 17 00:00:00 2001 From: ronald_araujo Date: Wed, 31 Jul 2019 11:26:52 -0300 Subject: [PATCH] Added optgroup --- jquery.tabledit.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/jquery.tabledit.js b/jquery.tabledit.js index 201e0e4..a526fbf 100644 --- a/jquery.tabledit.js +++ b/jquery.tabledit.js @@ -128,10 +128,24 @@ if (typeof jQuery === 'undefined') { // Create options for select element. $.each(jQuery.parseJSON(settings.columns.editable[i][2]), function(index, value) { - if (text === value) { - input += ''; + if (typeof value == "object") { + input += ''; + + $.each(value, function (i, e) { + if (text === e) { + input += ''; + } else { + input += ''; + } + }); + + input += ''; } else { - input += ''; + if (text === value) { + input += ''; + } else { + input += ''; + } } });