/**  
 * @author Van  
 * @constructor dictionary
 * @description "dictionary"
 * @date 2010-11-17
 * @since version 1.0 
 */  
$package('itsm.config.dataDictionary');

itsm.config.dataDictionary.dataDictionaryUtil = function(){
	
	

	return{
			
		/**
		 * @description 加载数据字典.
		 */
		loadOptionsByCode:function(groupCode,select){
			
			
			setTimeout(function(){//延迟加载
				
				$(select).html('<option value="">-- '+i18n["common_pleaseChoose"]+' --</option>');
				
				
				
				var url = 'dataDictionaryItems!findByCode.action?dataDictionaryQueryDto.groupCode='+groupCode;
				$.post(url,function(res){
					
					
					if(res!=null && res.length>0){
						for(var i=0;i<res.length;i++){
							
							$('<option value="'+res[i].dcode+'">'+res[i].dname+'</option>').appendTo(select);
						}
					}
				});	
				
				
			},0);
			
		}

	};
	
}();
