14,6 → 14,41 |
|
require_once dirname(__FILE__)."/init.php"; |
|
$scripts = " |
<script type='text/javascript'> |
(function($){ |
// очищаем select |
$.fn.clearSelect = function() { |
return this.each(function(){ |
if(this.tagName=='SELECT') { |
this.options.length = 0; |
$(this).attr('disabled','disabled'); |
} |
}); |
} |
// заполняем select |
$.fn.fillSelect = function(dataArray) { |
return this.clearSelect.each(function(){ |
if(this.tagName=='SELECT') { |
var currentSelect = this; |
$.each(dataArray,function(index,data) { |
var option = new Option(data.text,data.value); |
if($.support.cssFloat) { |
currentSelect.add(option,null); |
} else { |
currentSelect.add(option); |
} |
}); |
} |
}); |
} |
})(jQuery); |
</script> |
|
"; |
|
$smarty->assign('scripts', $scripts); |
|
$smarty->display('default.tpl'); |
|
?> |