summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/js/prado.js5
-rw-r--r--framework/Web/Javascripts/prado/element.js5
2 files changed, 4 insertions, 6 deletions
diff --git a/framework/Web/Javascripts/js/prado.js b/framework/Web/Javascripts/js/prado.js
index 0e71f733..955790ea 100644
--- a/framework/Web/Javascripts/js/prado.js
+++ b/framework/Web/Javascripts/js/prado.js
@@ -261,9 +261,8 @@ el.removeAttribute(attribute);else if(attribute.match(/^on/i))
el[attribute]=eval("(function(event){"+value+"})");else
el.setAttribute(attribute,value);},setOptions:function(element,options)
{var el=$(element);if(el&&el.tagName.toLowerCase()=="select")
-{while(el.length>0)
-el.remove(0);for(var i=0;i<options.length;i++)
-el.options[el.options.length]=new Option(options[i][0],options[i][1]);}},focus:function(element)
+{el.options.length=options.length;for(var i=0;i<options.length;i++)
+el.options[i]=new Option(options[i][0],options[i][1]);}},focus:function(element)
{var obj=$(element);if(typeof(obj)!="undefined"&&typeof(obj.focus)!="undefined")
setTimeout(function(){obj.focus();},100);return false;},replace:function(element,method,content,boundary,transport)
{if(boundary)
diff --git a/framework/Web/Javascripts/prado/element.js b/framework/Web/Javascripts/prado/element.js
index 51756cd0..82f281fb 100644
--- a/framework/Web/Javascripts/prado/element.js
+++ b/framework/Web/Javascripts/prado/element.js
@@ -46,10 +46,9 @@ Prado.Element =
var el = $(element);
if(el && el.tagName.toLowerCase() == "select")
{
- while(el.length > 0)
- el.remove(0);
+ el.options.length = options.length;
for(var i = 0; i<options.length; i++)
- el.options[el.options.length] = new Option(options[i][0],options[i][1]);
+ el.options[i] = new Option(options[i][0],options[i][1]);
}
},