瀏覽代碼

Debugging of the autocomplete on IE8.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@956 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 年之前
父節點
當前提交
abc013f112
共有 2 個文件被更改,包括 12 次插入12 次删除
  1. 1 0
      application/ui.autocompletewidget.class.inc.php
  2. 11 12
      js/autocompletewidget.js

+ 1 - 0
application/ui.autocompletewidget.class.inc.php

@@ -111,6 +111,7 @@ class UIAutoCompleteWidget
 EOF
 );
 		$iMinChars = $this->oAttDef->GetMinAutoCompleteChars();
+		$iFieldSize = $this->oAttDef->GetMaxSize();
 
 		// the input for the auto-complete
 		$sHTMLValue = "<input count=\"".count($this->aAllowedValues)."\" type=\"text\" id=\"label_$this->iId\" size=\"30\" maxlength=\"$iFieldSize\" value=\"$sDisplayValue\"/>&nbsp;";

+ 11 - 12
js/autocompletewidget.js

@@ -28,17 +28,16 @@ function AutocompleteWidget(id, sClass, sAttCode, sSuffix, oWizHelper)
 	this.Init = function()
 	{
 		// make sure that the form is clean
-		$('#linkedset_'+this.id+' .selection').each( function() { this.checked = false; });
 		$('#'+this.id+'_btnRemove').attr('disabled','disabled');
 		$('#'+this.id+'_linksToRemove').val('');
 	}
 	
 	this.StopPendingRequest = function()
 	{
-		if (this.ajax_request)
+		if (me.ajax_request)
 		{
-			this.ajax_request.Abort();
-			this.ajax_request = null;
+			me.ajax_request.Abort();
+			me.ajax_request = null;
 		}
 	}
 	
@@ -110,10 +109,10 @@ function AutocompleteWidget(id, sClass, sAttCode, sSuffix, oWizHelper)
 
 		// Make sure that we cancel any pending request before issuing another
 		// since responses may arrive in arbitrary order
-		this.StopPendingRequest();
+		me.StopPendingRequest();
 		
 		// Run the query and display the results
-		this.ajax_request = $.post( 'ajax.render.php', theMap, 
+		me.ajax_request = $.post( 'ajax.render.php', theMap, 
 			function(data)
 			{
 				$(sSearchAreaId).html(data);
@@ -146,10 +145,10 @@ function AutocompleteWidget(id, sClass, sAttCode, sSuffix, oWizHelper)
 	
 		// Make sure that we cancel any pending request before issuing another
 		// since responses may arrive in arbitrary order
-		this.StopPendingRequest();
+		me.StopPendingRequest();
 		
 		// Run the query and get the result back directly in JSON
-		this.ajax_request = $.post( 'ajax.render.php', theMap, 
+		me.ajax_request = $.post( 'ajax.render.php', theMap, 
 			function(data)
 			{
 				$('#label_'+me.id).val(data.name);
@@ -193,10 +192,10 @@ function AutocompleteWidget(id, sClass, sAttCode, sSuffix, oWizHelper)
 	
 		// Make sure that we cancel any pending request before issuing another
 		// since responses may arrive in arbitrary order
-		this.StopPendingRequest();
+		me.StopPendingRequest();
 		
 		// Run the query and get the result back directly in JSON
-		this.ajax_request = $.post( 'ajax.render.php', theMap, 
+		me.ajax_request = $.post( 'ajax.render.php', theMap, 
 			function(data)
 			{
 				$('#dcr_'+me.id).html(data);
@@ -251,10 +250,10 @@ function AutocompleteWidget(id, sClass, sAttCode, sSuffix, oWizHelper)
 			
 			// Make sure that we cancel any pending request before issuing another
 			// since responses may arrive in arbitrary order
-			this.StopPendingRequest();
+			me.StopPendingRequest();
 			
 			// Run the query and get the result back directly in JSON
-			this.ajax_request = $.post( 'ajax.render.php', theMap, 
+			me.ajax_request = $.post( 'ajax.render.php', theMap, 
 				function(data)
 				{
 					$('#label_'+me.id).val(data.name);