Buy now!

NinjaCombo

Sample 02. Refreshing options manually

HTML

                        

JS

                        $(document).ready(function () {
                            $(".ninjaCombo").ninjaCombo();
                        });

                        function Add() {
                            var opt = document.createElement('option');
                            opt.innerText = "Item " + parseInt(Math.random() * 100, 10);
                            $("#sample-01").append(opt);
                            $("#sample-01").ninjaComboUpdate();
                        }

                        function Disable() {
                            var isDisabled = $("#sample-01").is(":disabled");
                            $("#sample-01").disable(!isDisabled);
                            $("#sample-01").ninjaComboUpdate();
                        }