Pages

Sunday, January 26, 2014

Select2.js configuration

   if (typeof $.fn.select2 != 'undefined')
                    {
                        var tags= 'one, two, three';
                        $("#selectTags").select2({
                            placeholder: "Select options",
                            selectOnBlur: false,
                            openOnEnter: true,
                            blurOnChange: true,
                            allowClear: false,
                            tags: tags
                        });

                    }

wysihtml5 configuration

     $('.wysihtml5').wysihtml5({
                     link: false,
                     'font-styles': true,
                     emphasis: true,
                     lists: true,
                     html: false,
                     image: false,
                     'color': true,
                     'format-code': false,
                     events: {
                     load: function() {
                       console.log('lodded');
                     }
                     }
                     });

wysihtml5 field update

$(" #myfiled").val('');
 $('#myfield').data("wysihtml5").editor.setValue('');