Fix the data-role parameter

This commit is contained in:
Laurent Destailleur 2015-04-15 18:14:26 +02:00
parent 44f10ebec2
commit 8511f1f7ef
2 changed files with 9 additions and 5 deletions

View File

@ -362,8 +362,12 @@ class FormOther
if ($conf->use_javascript_ajax)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($htmlname);
$nodatarole=' data-role="none"';
$htmlforcombo = ajax_combobox($htmlname);
if ($htmlforcombo)
{
$out.= $htmlforcombo;
$nodatarole=' data-role="none"';
}
}
// Select each sales and print them in a select input
$out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';

View File

@ -314,7 +314,7 @@ function ajax_dialog($title,$message,$w=350,$h=150)
* @param string $htmlname Name of html select field
* @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
* @return string Return html string to convert a select field into a combo
* @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason.
*/
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
{
@ -323,8 +323,8 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works)
if (! empty($conf->dol_use_jmobile)) return ''; // combobox with jmobile (does not works)
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
if (empty($conf->use_javascript_ajax)) return '';
if (empty($conf->use_javascript_ajax)) return '';
/* Some properties for combobox:
minLengthToAutocomplete: 2,
comboboxContainerClass: "comboboxContainer",