diff options
author | wei <> | 2006-07-03 04:14:34 +0000 |
---|---|---|
committer | wei <> | 2006-07-03 04:14:34 +0000 |
commit | f923f4cd3c0e4c71e981ac6384f40cbb0b3c0968 (patch) | |
tree | deb8649c2c91099e993f06414dc1114a8fea0d03 /framework | |
parent | 7e002c23edc5fb5db70935591aa6adeda25fc7fb (diff) |
Fixed drop down list javascript problems in IE
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/Javascripts/js/prado.js | 5 | ||||
-rw-r--r-- | framework/Web/Javascripts/prado/element.js | 5 | ||||
-rw-r--r-- | framework/Web/UI/ActiveControls/TActiveListControlAdapter.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TListControl.php | 10 |
4 files changed, 10 insertions, 12 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]);
}
},
diff --git a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php index 592c4c14..e6f3759a 100644 --- a/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php +++ b/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php @@ -27,7 +27,7 @@ Prado::using('System.Web.UI.WebControls.TListControl'); * @package System.Web.UI.ActiveControls * @since 3.0 */ -class TActiveListControlAdapter extends TActiveControlAdapter implements IListControlAdaptee +class TActiveListControlAdapter extends TActiveControlAdapter implements IListControlAdapter { /** * @return boolean true if can update client-side attributes. diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index b070f26b..bd883590 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -436,7 +436,7 @@ abstract class TListControl extends TDataBoundControl throw new TInvalidDataValueException('listcontrol_selectedindex_invalid',get_class($this),$index);
}
$this->_cachedSelectedIndex=$index;
- if($this->getAdapter() instanceof IListControlAdaptee)
+ if($this->getAdapter() instanceof IListControlAdapter)
$this->getAdapter()->setSelectedIndex($index);
}
@@ -472,7 +472,7 @@ abstract class TListControl extends TDataBoundControl }
}
- if($this->getAdapter() instanceof IListControlAdaptee)
+ if($this->getAdapter() instanceof IListControlAdapter)
$this->getAdapter()->setSelectedIndices($indices);
}
@@ -517,7 +517,7 @@ abstract class TListControl extends TDataBoundControl throw new TInvalidDataValueException('listcontrol_selectedvalue_invalid',get_class($this),$value);
}
$this->_cachedSelectedValue=$value;
- if($this->getAdapter() instanceof IListControlAdaptee)
+ if($this->getAdapter() instanceof IListControlAdapter)
$this->getAdapter()->setSelectedValue($value);
}
@@ -559,7 +559,7 @@ abstract class TListControl extends TDataBoundControl }
}
- if($this->getAdapter() instanceof IListControlAdaptee)
+ if($this->getAdapter() instanceof IListControlAdapter)
$this->getAdapter()->setSelectedValues($values);
}
@@ -590,7 +590,7 @@ abstract class TListControl extends TDataBoundControl $item->setSelected(false);
}
- if($this->getAdapter() instanceof IListControlAdaptee)
+ if($this->getAdapter() instanceof IListControlAdapter)
$this->getAdapter()->clearSelection();
}
|