bootstrap-iconpicker icon indicating copy to clipboard operation
bootstrap-iconpicker copied to clipboard

Reset Iconpicker

Open henningwerner opened this issue 8 years ago • 3 comments

How is it possible to reset the Icon picker? I want to set during the runtime another icon.

I see it's possible with: .iconpicker('setIcon', 'fa-wifi') The problem here is the icon picker doesn't shows the selected icon page.

I've done several trials to reset it via:

1.) .iconpicker('reset') 2.) Initialize via JS and clear content before:

$('#editCategoryIcon').empty().iconpicker({
  align: 'left',
  footer: false,
  icon: icon,
  iconset: 'fontawesome',
  rows: 5,
  search: true,
  searchText: 'Suchen...'
});

But I can't figure it out, any ideas?

henningwerner avatar May 26 '16 13:05 henningwerner

Something like this fiddle using a clone ?

$('#my_checkbox').on('change', function(){
	if ($(this).is(':checked')) {
  	$('#my_iconpicker').iconpicker();
  } else {
    var source = $('#my_iconpicker');
  	source.unbind().empty();
    var clone = source.clone(false);
    source.remove();
    $('label').before(clone);
  }
});

$('#setIcon').on('click', function(){
	$('#my_iconpicker').iconpicker('setIcon', 'fa-wifi')
})

pbenard73 avatar May 17 '17 20:05 pbenard73

Solution is to clear the value (val)... $('.notify_icon').val('').iconpicker('setIcon', notify_icon);

eformx avatar Aug 30 '18 22:08 eformx

I just got some simply reset option here

$('#iconpicker').iconpicker() $('#iconpicker').iconpicker('setIcon', 'empty')

harshitpeer avatar Aug 07 '20 09:08 harshitpeer