How Can I Make The Delete Button Triggered When Clicked?

There is category add field in product page. (See attached image.) I know, there are javascript hooks in cs cart. I want let the delete/remove button trigged and redirect it somewhere I want when clicked to remove like code below:

$.ceAjax('request', fn_url('' + ), {


Normally, I can use a redirection when clicked to add a category:

  $.ceEvent('on', 'ce.select_template_selection', function (object, list_elm, $container) {
	if ($container.hasClass('cm-object-categories-add') && {

                    $.ceAjax('request', fn_url('' + + '&time=' + time ), {



I just want to do it when clikced to remove after selected of template.

In the following file \js\lib\select2\select2.full.min.js there are some code which makes it triggered.

This line:


How can I use a hooks to use this? BTW, I need ID of category which is clicked to remove. I am not sure if this ID is in b variable.

You may aslo help about using functions in \js\lib\select2\select2.full.min.js file. That can help me.

Cs cart uses select2 functions which are defined in \js\lib\select2\select2.full.min.js file.

I found that I should use select2 functions. If you need something like this check out the link following :