EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jega on December 03, 2017, 01:15:43 PM



Title: tagbox onRemoveTag
Post by: jega on December 03, 2017, 01:15:43 PM
Hi.

Have a tagbox with values 1,2,3

Removing item with value 3

onRemoveTag: function(val){
   var catTypeIDList = $('#catTypeID').tagbox('getValues');
   
},

val of onRemoveTag is 3, but catTypeIDList is still 1,2,3

Need to update something when removing a tag, with the remaining values (1,2)

Any help ??


Jeesper


Title: Re: tagbox onRemoveTag
Post by: jarry on December 03, 2017, 05:15:29 PM
The 'onRemoveTag' event fires before 'onChange' event. You should delay a little time to get values, or use the 'onChange' event instead.
Code:
onRemoveTag: function(){
var target = this;
setTimeout(function(){
var values = $(target).tagbox('getValues');
console.log(values)
},0)
}