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/
This commit is contained in:
parent
474c43e433
commit
52b0918297
1 changed files with 2 additions and 2 deletions
|
|
@ -38,7 +38,7 @@ var Select2 = {
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
el.select2()
|
el.select2()
|
||||||
.on("change", function(e) {
|
.on("change", function(e) {
|
||||||
var id = el.select2("val");
|
var id = el.val();
|
||||||
m.startComputation();
|
m.startComputation();
|
||||||
//Set the value to the selected option
|
//Set the value to the selected option
|
||||||
ctrl.data.map(function(d){
|
ctrl.data.map(function(d){
|
||||||
|
|
@ -48,7 +48,7 @@ var Select2 = {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof ctrl.onchange == "function"){
|
if (typeof ctrl.onchange == "function"){
|
||||||
ctrl.onchange(el.select2("val"));
|
ctrl.onchange(el.val());
|
||||||
}
|
}
|
||||||
m.endComputation();
|
m.endComputation();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue