0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

双击事件-- 显示信息详情

Last updated at Posted at 2019-06-23
  • 做一个显示详情的窗口
teacherList.html
<!-- 弹出详情窗口 -->
	<div id="detail"  class="easyui-window" title="企业详情" >
		<table border="1px" bordercolor="#000000" width="100%" hight="100%" 
		cellspacing="0px" style="border-collapse:collapse">
								
			<tr>
				<td>登录名</td>
				<td id="desc_tid"></td>
			</tr>
		
		<tr>
			<td>密码</td>
			<td id="desc_tpwd"></td>
		</tr>
		<tr>
			<td>老师姓名</td>
			<td id="desc_tname"></td>
		</tr>
		<tr>
			<td>性别</td>
			<td id="desc_tgender"></td>
		</tr>
		<tr>
			<td>年龄</td>
			<td id="desc_tage"></td>
		</tr>
		<tr>
			<td>电话</td>
			<td id="desc_ttel"></td>
		</tr>
		<tr>
			<td>老师地址</td>
			<td id="desc_taddress"></td>
		</tr>
		 <tr>
			<td>班级</td>
			<td id="desc_tclass"></td>
		</tr> 
		<tr>
			<td>状态</td>
			<td id="desc_tstatus"></td>
		</tr>
		
		
		</table>
	
	
	
	
	
	
	</div>
  • 设定一下这个详情窗口 在js代码中,$(function(){ 中})
teacherList.html
$(function() {	
		//详情页面
		
		$("#detail").window({
			
			minimizable:false,
			width:600,
			height:400,
			modal:true,//模态化
			iconCls:'icon-large-clipart',
			//关闭状态么? 是的。 
			closed:true		
			
		});	
  • 在datagrid 初始化中
teacherList.html
  //详情页面 
	        onDblClickRow:function(index,Teacher){
//设置老师的显示值。
	        	var status = "";
				if(Teacher.tstatus == 0){
					status = "在职";
				}
				if(Teacher.tstatus == 1){
					status = "离职";
				}

//设置班级的显示值  step1:先combobox 遍历拿到一个List 
				var sclassList = $("#search_tclass").combobox("getData");
	        	
	        	
	        	$("#detail").window('open');//打开窗口
	        	
	        	$("#desc_tid").html(Teacher.tid);
	        	$("#desc_tpwd").html(Teacher.tpwd);
	        	$("#desc_tname").html(Teacher.tname);
	        	$("#desc_tgender").html(Teacher.tgender);
	        	$("#desc_tage").html(Teacher.tage);
	        	$("#desc_ttel").html(Teacher.ttel);
	        	$("#desc_taddress").html(Teacher.taddress);	

//设置班级的显示值  step2: 显示下标在集合里对应的元素的 班级名字。 
	        	$("#desc_tclass").html(sclassList[index].cname);
	
	        	$("#desc_tstatus").html(status);	        		        	
	        }
	    }); 

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?