Editor Bootstrap-select plugin
Editor Bootstrap-select plugin
rdueck
Posts: 12Questions: 2Answers: 0
I've made a small improvement to the code posted at https://www.datatables.net/forums/discussion/38374/editor-bootstrap-select-plugin. Replacing lines 34-36 of the Javascript with the following allows for data-
attributes to be set on each <option>
:
DataTable.Editor.pairs(options, conf.optionsPair, function (val, label, i) {
elOpts[i] = new Option(label, val);
var opts = options[i];
for (var k in opts) {
if (k.substr(0,5) == 'data-') {
$(elOpts[i]).data(k.substr(5), opts[k]);
}
}
});
Replies
Nice, thanks for posting,
Colin