$('.dp-select2').each(function() {
        var placeholderlabel = $(this).data('placeholderlabel');
        var placeholdervalue = $(this).data('placeholdervalue');
        var closeOnSelect = $(this).data('closeOnSelect');
        var dropdownCssClass = $(this).data('dropdownCssClass');
        var minimumResultsForSearch = $(this).data('minimumResultsForSearch');

        var options = {};
        if(placeholderlabel || placeholdervalue) {
                options.placeholder = {};
                //options.allowClear = true;
        }
        if(placeholderlabel) {
                options.placeholder.text = placeholderlabel;
        }
        if(placeholdervalue) {
                options.placeholder.id = placeholdervalue;
        } else if(placeholderlabel) {
                options.placeholder.id = '';
        }
    if(closeOnSelect == 0) {
        options.closeOnSelect = false;
    }
    if(dropdownCssClass) {
        options.dropdownCssClass = dropdownCssClass;
    }
    if(typeof minimumResultsForSearch != 'undefined') {
        options.minimumResultsForSearch = minimumResultsForSearch;
    }
    $(this).select2(options);
});
