Regarding Drop-Down reset population

I have confirmation box, on click of ok I’m doing some calculation, but on click of cancel, I want to reset the drop-down value(previous value).
I’m doing like.
root.$$(“Pr”).attachEvent(“onChange”, function(newv, oldv){
webix.confirm({
ok:“Confirm”, cancel:“Cancel”,
width: “200px”,
text:changeLocle(“Hello”),
callback:function(result){
if(result){
//message any operation
}else{

									  global_root.$$('Pr').setValue(oldv);

return false
}
});

but problem is like, I 'm getting continuous confirmation box on click of cancel like infinite loop.
Can you please suggest , How to resolve this issue.
Thanks.

Hi, you need to stop event flow for the component temporarily, as setValue call triggers onChange event where you call setValue method … and so on.

Use blockEvent() and unblockEvent() to prevent the infinite loop.

http://webix.com/snippet/e748e228