Editor Bootstrap-select plugin

Editor Bootstrap-select plugin

rdueckrdueck 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

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Nice, thanks for posting,

    Colin

Sign In or Register to comment.