From 52b0918297b0d19fca4deefe94674dfff4fd7671 Mon Sep 17 00:00:00 2001 From: Syaiful Bahri Date: Sun, 5 Jun 2016 04:32:22 +0700 Subject: [PATCH] update integration docs correct the code example to avoid infinite loop the infinite loop occure because the code example also update the value on change handler. issue #954. prove https://jsfiddle.net/syaiful6/kps3gabo/ --- docs/integration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/integration.md b/docs/integration.md index 81c94a5c..918b6c08 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -38,7 +38,7 @@ var Select2 = { if (!isInitialized) { el.select2() .on("change", function(e) { - var id = el.select2("val"); + var id = el.val(); m.startComputation(); //Set the value to the selected option ctrl.data.map(function(d){ @@ -48,7 +48,7 @@ var Select2 = { }); if (typeof ctrl.onchange == "function"){ - ctrl.onchange(el.select2("val")); + ctrl.onchange(el.val()); } m.endComputation(); });