Ver código fonte

Added a display value for the null (i.e empty) value of a combo/autocomplete.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1286 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 anos atrás
pai
commit
a5e51c12ee
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      application/ui.extkeywidget.class.inc.php

+ 3 - 2
application/ui.extkeywidget.class.inc.php

@@ -125,7 +125,8 @@ class UIExtKeyWidget
 			$sHTMLValue = "<select title=\"$sHelpText\" name=\"{$sAttrFieldPrefix}{$sFieldName}\" id=\"$this->iId\">\n";
 			if ($bSearchMode)
 			{
-				$sHTMLValue .= "<option value=\"\">".Dict::S('UI:SearchValue:Any')."</option>\n";			
+				$sDisplayValue = isset($aArgs['sDefaultValue']) ? $aArgs['sDefaultValue'] : Dict::S('UI:SearchValue:Any');
+				$sHTMLValue .= "<option value=\"\">$sDisplayValue</option>\n";			
 			}
 			else
 			{
@@ -187,7 +188,7 @@ EOF
 <<<EOF
 		oACWidget_{$this->iId} = new ExtKeyWidget('{$this->iId}', '{$this->sTargetClass}', '$sFilter', '$sTitle', false, $sWizHelper);
 		oACWidget_{$this->iId}.emptyHtml = "<div style=\"background: #fff; border:0; text-align:center; vertical-align:middle;\"><p>$sMessage</p></div>";
-		$('#label_$this->iId').autocomplete('./ajax.render.php', { scroll:true, minChars:{$iMinChars}, formatItem:formatItem, autoFill:false, matchContains:true, keyHolder:'#{$this->iId}', extraParams:{operation:'ac_extkey', sTargetClass:'{$this->sTargetClass}',sFilter:'$sFilter', json: $sWizHelperJSON }});
+		$('#label_$this->iId').autocomplete('../pages/ajax.render.php', { scroll:true, minChars:{$iMinChars}, autoFill:false, matchContains:true, keyHolder:'#{$this->iId}', extraParams:{operation:'ac_extkey', sTargetClass:'{$this->sTargetClass}',sFilter:'$sFilter', json: $sWizHelperJSON }});
 		$('#label_$this->iId').blur(function() { $(this).search(); } );
 		$('#label_$this->iId').keyup(function() { if ($(this).val() == '') { $('#$this->iId').val(''); } } ); // Useful for search forms: empty value in the "label", means no value, immediatly !
 		$('#label_$this->iId').result( function(event, data, formatted) { OnAutoComplete('{$this->iId}', event, data, formatted); } );