??????????

2011-12-27 13:35:35by Rocky

操作dom元素

如果没有id或者class的情况下获取dom元素会比较困难

 
		               
			function hidetest() {
				var input = document.getElementById("user_name_id");
				input.style.display = "none";// hide this element
				input.style.display = "block"; 
			}
		
		

在grid中调用hideColumn和showColumn方法

只对grid中的列有效

 
		               
			var grid = $("grid_id");
			grid.hideColumn('testColumnName');
			grid.showColumn('testColumnName');
		
		

使用switch和case标签

服务端解析sreen的时候根据参数把符合条件的代码加入到解析后的响应页面中,与前种方式不同,是在服务端实现的隐藏和显示

 
		         
			<p:switch test="待检测的参数名">
				<p:case value="匹配值1">
					<!--代码块1-->
				</p:case>
			.....
				<p:case value="*">
					<!-- 相当于 switch 语句中的 default-->
				</p:case>
			</p:switch>
		
		
Demo
    Attachments

      Comments

      1 Responses to the article
      1. [email protected] 留言于:2019年07月27日 15:34
        很好,希望能够持续更新
      发表评论