Add showempty into combobox
This commit is contained in:
parent
395e09d64d
commit
d2e2dabf26
@ -32,6 +32,7 @@ require '../../main.inc.php';
|
|||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$htmlname = GETPOST('htmlname','alpha');
|
$htmlname = GETPOST('htmlname','alpha');
|
||||||
|
$showempty = GETPOST('showempty','int');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -47,8 +48,9 @@ if (! empty($id) && ! empty($action) && ! empty($htmlname))
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$return=array();
|
$return=array();
|
||||||
|
if (empty($showempty)) $showempty=0;
|
||||||
|
|
||||||
$return['value'] = $form->selectcontacts($id,'','contactid',0,'','',0,'',true);
|
$return['value'] = $form->selectcontacts($id,'','contactid',$showempty,'','',0,'',true);
|
||||||
$return['num'] = $form->num;
|
$return['num'] = $form->num;
|
||||||
$return['error'] = $form->error;
|
$return['error'] = $form->error;
|
||||||
|
|
||||||
|
|||||||
@ -348,11 +348,13 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
|
|||||||
var method = obj.method;
|
var method = obj.method;
|
||||||
var url = obj.url;
|
var url = obj.url;
|
||||||
var htmlname = obj.htmlname;
|
var htmlname = obj.htmlname;
|
||||||
|
var showempty = obj.showempty;
|
||||||
$.getJSON(url,
|
$.getJSON(url,
|
||||||
{
|
{
|
||||||
action: method,
|
action: method,
|
||||||
id: id,
|
id: id,
|
||||||
htmlname: htmlname
|
htmlname: htmlname,
|
||||||
|
showempty: showempty
|
||||||
},
|
},
|
||||||
function(response) {
|
function(response) {
|
||||||
$.each(obj.params, function(key,action) {
|
$.each(obj.params, function(key,action) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user