Skip to content

Instantly share code, notes, and snippets.

@dudelis
Created March 6, 2018 11:31
Show Gist options
  • Select an option

  • Save dudelis/101991a00f86426ec3022418de470975 to your computer and use it in GitHub Desktop.

Select an option

Save dudelis/101991a00f86426ec3022418de470975 to your computer and use it in GitHub Desktop.
K2: Draggable listbox options
//Converting the 'text' into '{text}' for the Email Templating placeholders
var dragListBox = function(ev) {
ev.dataTransfer.setData("text",'{' + ev.srcElement.text + '}');
};
//Adding html attributes to make the inner items draggable
$('div[name="NameOfYourListBox"]')
.find('.optionwrapper')
.find('.option')
.attr('draggable', 'true')
.attr('ondragstart', 'dragListBox(event)');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment