Selectize clear selection on Dropdown Click

Selectize clear selection on Dropdown Click

Today, We want to share with you Selectize clear selection on Dropdown Click.In this post we will show you How to clear a selected value selectize.js dropdown, hear for Delete / Remove / Clear all items (options) from DropDownList in selectize we will give you demo and example for implement.In this post, we will learn about javascript How to clear a selected value selectize.js dropdown with an example.

Selectize clear selection on Dropdown Click

There are the Following The simple About Selectize clear selection on Dropdown Click Full Information With Example and source code.

As I will cover this Post with live Working example to develop Clear Selectize Control on Dropdown Click, so the some major files and Directory structures for this example is following below.

  Vuejs set focus Textbox Components

Re-fill selectize js value

jQuery(function ($) {
    var $select = $('#list_products').selectize({
        persist: false,
        create: true
    });

    $("#btnProductClear").on("click", function () {
        var product_selectize = $select[0].selectize;
        product_selectize.clear();

    });
});

Selectize JS Clear Example

( function ( $ ) {
    $( document ).ready( function () {

        $body.find( 'select' ).each( function () {
            var $select = $( this ).selectize();

            // Clear all the selected items/products from selectize control on dropdown click
            $( '#list_products .selectize-control' ).on( 'click', function () {
                var product_selectize = $select[0].selectize;
                product_selectize.clear(true);
            });
        } );

    });
}( jQuery ) );

clear-selectize-control-on-click

 var $select = $('#list_products').selectize();
 var control = $select[0].selectize;
 control.clear();

clear a selected value selectize.js dropdown
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

  Laravel 7 Generate/Create PDF File Tutorial From Scratch

I hope you get an idea about Selectize clear selection on Dropdown Click.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.