diff options
| author | wei <> | 2006-10-06 03:46:05 +0000 | 
|---|---|---|
| committer | wei <> | 2006-10-06 03:46:05 +0000 | 
| commit | fe60cc221f922ea362826e2d00431c5df28fe85f (patch) | |
| tree | 9c0449718a862a5b51d62c4ac9697db15c13863f /framework/Web/Javascripts/js/debug/ajax.js | |
| parent | 9fee2935d91e92235b068632d3608c748ef41bfe (diff) | |
fixed #410 #412
Diffstat (limited to 'framework/Web/Javascripts/js/debug/ajax.js')
| -rw-r--r-- | framework/Web/Javascripts/js/debug/ajax.js | 32 | 
1 files changed, 17 insertions, 15 deletions
diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js index 77df7bc2..ba777546 100644 --- a/framework/Web/Javascripts/js/debug/ajax.js +++ b/framework/Web/Javascripts/js/debug/ajax.js @@ -2614,6 +2614,7 @@ Prado.WebUI.TRatingList = Base.extend(  {
  	selectedIndex : -1,
  	enabled : true,
 +	readOnly : false,
  	constructor : function(options)
  	{
 @@ -2632,20 +2633,20 @@ Prado.WebUI.TRatingList = Base.extend(  	_init: function(options)
  	{
  		Element.addClassName($(this.options.ListID),this.options.Style);
 -		var radios = document.getElementsByName(this.options.ListName);
  		this.radios = new Array();
  		var index=0;
 -		for(var i = 0; i<radios.length; i++)
 +		for(var i = 0; i<this.options.ItemCount; i++)
  		{
 -			var node = radios[i].parentNode;
 -			if(node.tagName.toLowerCase()=='td')
 +			var radio = $(this.options.ListID+'_c'+i);
 +			var td = radio.parentNode;
 +			if(radio && td.tagName.toLowerCase()=='td')
  			{
 -				this.radios.push(radios[i]);
 -				Event.observe(node, "mouseover", this.hover.bindEvent(this,index));
 -				Event.observe(node, "mouseout", this.recover.bindEvent(this,index));
 -				Event.observe(node, "click", this.click.bindEvent(this, index));
 +				this.radios.push(radio);
 +				Event.observe(td, "mouseover", this.hover.bindEvent(this,index));
 +				Event.observe(td, "mouseout", this.recover.bindEvent(this,index));
 +				Event.observe(td, "click", this.click.bindEvent(this, index));
  				index++;
 -				Element.addClassName(node,"rating");
 +				Element.addClassName(td,"rating");
  			}
  		}
  	},
 @@ -2656,7 +2657,7 @@ Prado.WebUI.TRatingList = Base.extend(  		for(var i = 0; i<this.radios.length; i++)
  		{
  			var action = i <= index ? 'addClassName' : 'removeClassName'
 -			Element[action](this.radios[i].parentNode,"rating_hover");
 +			Element[action](this.radios[i].parentNode,"rating_selected");
  		}
  		this.setCaption(index);
  	},
 @@ -2665,7 +2666,7 @@ Prado.WebUI.TRatingList = Base.extend(  	{
  		if(this.enabled==false) return;
  		for(var i = 0; i<=index; i++)
 -			Element.removeClassName(this.radios[i].parentNode, "rating_hover");
 +			Element.removeClassName(this.radios[i].parentNode, "rating_selected");
  		this.setRating(this.selectedIndex);
  	},
 @@ -2679,7 +2680,7 @@ Prado.WebUI.TRatingList = Base.extend(  		var requestOptions = Object.extend(
  		{
  			ID : this.options.ListID+"_c"+index,
 -			EventTarget : this.options.ListName+"$c"+index
 +			EventTarget : this.options.ListID+"$c"+index
  		},this.options);
  		var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions);
  		if(request.dispatch()==false)
 @@ -2688,9 +2689,11 @@ Prado.WebUI.TRatingList = Base.extend(  	setRating: function(index)
  	{
 +
  		for(var i = 0; i<this.radios.length; i++)
  		{
 -			var action = i <= index ? 'addClassName' : 'removeClassName'
 +			var node = this.radios[i].parentNode;
 +			var action = i > index ? 'removeClassName' : 'addClassName'
  			Element[action](this.radios[i].parentNode, "rating_selected");
  		}
  		this.setCaption(index);
 @@ -2701,7 +2704,7 @@ Prado.WebUI.TRatingList = Base.extend(  		var value = index > -1 ? this.radios[index].value : this.options.caption;
  		var caption = $(this.options.CaptionID);
  		if(caption) caption.innerHTML = value;
 -		$(this.options.ListName).title = value;
 +		$(this.options.ListID).title = value;
  	},
  	setEnabled : function(value)
 @@ -2711,7 +2714,6 @@ Prado.WebUI.TRatingList = Base.extend(  		{
  			var action = value ? 'removeClassName' : 'addClassName'
  			Element[action](this.radios[i].parentNode, "rating_disabled");
 -			Element.removeClassName(this.radios[i].parentNode, "rating_hover");
  		}
  	}
  },
  | 
