trigger change event when updating item value
This commit is contained in:
parent
122fc5eaa7
commit
0cdf208f3d
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2007-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -48,7 +49,7 @@ function ajax_autocompleter($selected,$htmlname,$url,$option='',$minLength=2,$au
|
|||||||
if (this.value.length == 0)
|
if (this.value.length == 0)
|
||||||
{
|
{
|
||||||
jQuery("#search_'.$htmlname.'").val("");
|
jQuery("#search_'.$htmlname.'").val("");
|
||||||
jQuery("#'.$htmlname.'").val("");
|
jQuery("#'.$htmlname.'").val("").trigger("change");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
jQuery("input#search_'.$htmlname.'").autocomplete({
|
jQuery("input#search_'.$htmlname.'").autocomplete({
|
||||||
@ -57,7 +58,7 @@ function ajax_autocompleter($selected,$htmlname,$url,$option='',$minLength=2,$au
|
|||||||
response( jQuery.map( data, function( item ) {
|
response( jQuery.map( data, function( item ) {
|
||||||
if (autoselect == 1 && data.length == 1) {
|
if (autoselect == 1 && data.length == 1) {
|
||||||
jQuery("#search_'.$htmlname.'").val(item.value);
|
jQuery("#search_'.$htmlname.'").val(item.value);
|
||||||
jQuery("#'.$htmlname.'").val(item.key);
|
jQuery("#'.$htmlname.'").val(item.key).trigger("change");
|
||||||
}
|
}
|
||||||
var label = item.label.toString();
|
var label = item.label.toString();
|
||||||
return { label: label, value: item.value, id: item.key}
|
return { label: label, value: item.value, id: item.key}
|
||||||
@ -67,7 +68,7 @@ function ajax_autocompleter($selected,$htmlname,$url,$option='',$minLength=2,$au
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
minLength: '.$minLength.',
|
minLength: '.$minLength.',
|
||||||
select: function( event, ui ) {
|
select: function( event, ui ) {
|
||||||
jQuery("#'.$htmlname.'").val(ui.item.id);
|
jQuery("#'.$htmlname.'").val(ui.item.id).trigger("change");
|
||||||
}
|
}
|
||||||
}).data( "autocomplete" )._renderItem = function( ul, item ) {
|
}).data( "autocomplete" )._renderItem = function( ul, item ) {
|
||||||
return jQuery( "<li></li>" )
|
return jQuery( "<li></li>" )
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user