jquery css 簡單筆記

來源:互聯網
上載者:User

標籤:style   http   io   java   ar   for   資料   art   sp   

1、執行個體  資料來自後台,唯寫前台處理方法 

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="erp" uri="/erp-tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<LINK href="../../../system/doctors/dept/styles.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../skin/style_140605.css" />
<script src="../../../system/doctors/dept/searchbox.js" charset="gbk" ></script>
<script language="javascript" src="../../../system/staff_manage/jilu/LodopFuncs.js"></script>
<script language="javascript" src="../../../jslib/json.js"></script>
<style>
#Tablist2 tr th{
word-break:keep-all;
}
</style>
<html>
<script>
jQuery(function(){
var data=${jobhistoryListjson}; //從後台擷取列表資料
var datastr="";
jQuery.each(data, function(i, n){
//alert(JSON.stringify(n));
var index=i+1;
datastr+="<tr><td>"+index+"</td><td>"+n.user_name+"</td><td>"+n.dept_name+"</td><td>"+n.start_datetime+"</td><td>"+n.end_datetime+"</td>"
// +"<td>"+n.job+"</td><td style=‘width:400px;‘>"+n.category+"</td><td>"+n.source+"</td><td>"+n.address+"</td><td>"+n.review+"</td><td>"+n.content+"</td>"
+"<td>"+n.job+"</td><td>"+n.category+"</td><td>"+n.source+"</td><td>"+n.address+"</td>"
+"<td><input data=‘"+JSON.stringify(n)+"‘ type=‘button‘ class=‘inputbutton‘ value=‘編輯‘ />"
+"<input data=‘"+n.jobhistory_id+"‘ type=‘button‘ class=‘inputbutton‘ value=‘刪除‘ /></td></tr>";

});
jQuery("#Tablist2").append(datastr);
jQuery("#Tablist2 input[type=‘button‘]").click(function(){

if(jQuery(this).attr("value")=="編輯")
{
if(jQuery(this).attr("data")!=null&&jQuery(this).attr("data")!="")
{
var item = JSON.parse(jQuery(this).attr("data"));

jQuery("#jobhistory_jobhistory_id").val(item.jobhistory_id);
jQuery("#jobhistory_user_name").val(item.user_name);
jQuery("#jobhistory_dept_code").val(item.dept_code);
document.getElementById("jobhistory.start_datetime").value= item.start_datetime;
document.getElementById("jobhistory.end_datetime").value= item.end_datetime;
jQuery("#jobhistory_job").val(item.job);
jQuery("#jobhistory_category").val(item.category);
jQuery("#jobhistory_source").val(item.source);
jQuery("#jobhistory_address").val(item.address);
jQuery("#jobhistory_review").val(item.review);
jQuery("#jobhistory_content").val(item.content);
}
}
else if(jQuery(this).attr("value")=="刪除")
{
if(jQuery(this).attr("data")!=null&&jQuery(this).attr("data")!="")
{
var deletes = jQuery(this).attr("data");
deleteDataall(deletes);
}
}
});
});
</script>
<body >
<br/>
<table cellpadding="0" cellspacing="0" id="Tablist2">
<tr>
<th width="30">序號</th>
<th width="150">醫生</th>
<th width="150">科室</th>
<th width="150">開始時間</th>
<th width="150">結束時間</th>
<th width="150">擔當職務</th>
<th width="400">工作類別</th>
<th width="150">任務來源</th>
<th width="150">地點</th>
<%--
<th width="350">工作評價</th>
<th width="350">工作內容</th>
--%>
<th>操作</th>
</tr>
</table>
<br />
<br />
<form action="" id="form1">
<table cellpadding="0" cellspacing="0" id="Tablist1">
<s:hidden name="jobhistory.jobhistory_id" ></s:hidden>
<s:hidden name="jobhistory.user_name" ></s:hidden>
<s:hidden name="jobhistory.dept_code" ></s:hidden>
<s:hidden name="dept_code"></s:hidden>
<s:hidden name="dengluming"></s:hidden>
<s:hidden name="userId"></s:hidden>
<input type="hidden" id="flagsString" name="flagsString" value="true"/>
<tr>
<td class="t_name">開始時間</td>
<td><input type="text" readonly="readonly" id="jobhistory.start_datetime" name="jobhistory.start_datetime" value="" class="datetimeText1" /></td>
<td class="t_name">結束時間</td>
<td><input type="text" readonly="readonly" id="jobhistory.end_datetime" name="jobhistory.end_datetime" value="" class="datetimeText1"/></td>
</tr>
<tr>
<td class="t_name">擔當職務</td>
<td><s:textfield name="jobhistory.job" cssClass="required" ></s:textfield></td>
<td class="t_name">工作類別</td>
<td><s:select list="categoryList" name="jobhistory.category" listKey="dict_child_id" listValue="dict_child_name" headerKey="" headerValue="請選擇" /></td>
</tr>
<tr>
<td class="t_name">任務來源</td>
<td><s:select list="sourceList" name="jobhistory.source" listKey="dict_child_id" listValue="dict_child_name" headerKey="" headerValue="請選擇" /></td>
<td class="t_name">地點</td>
<td><s:textfield name="jobhistory.address" cssClass="required"></s:textfield></td>
</tr>
<tr>
<td class="t_name">工作評價</td>
<td><s:textarea name="jobhistory.review" style="width:320px"></s:textarea></td>
<td class="t_name">工作內容</td>
<td><s:textarea name="jobhistory.content" style="width:320px" ></s:textarea></td>
</tr>
<tr>
<td colspan="4" id="btn_control">
<input type="button" class="inputbutton" value="清空" title="清空" id="btnrest"/>
<input type="button" class="inputbutton" value="保&nbsp;&nbsp;存" title="儲存" onclick="saveNew();"/>
<input type="button" class="inputbutton" value="返&nbsp;&nbsp;回" title="返回" onclick="goToBack();"/>
</td>
</tr>
</table>
</form>

</body>
</html>
<script type="text/javascript">
$(document).ready( function() {
$("#roleTable").tablesorter({
widgets: [‘zebra‘,‘columnHighlight‘,‘rowHover‘],
headers:{ 0: { sorter: false}},
cancelSelection:true
});
$("#btnrest").click(function(){
$("#jobhistory_jobhistory_id").val("");

$(‘input‘,‘#form1‘)
.not(‘:button,:submit,:reset,:hidden‘) //將myform表單中input元素type為button、submit、reset、hidden排除
.val(‘‘) //將input元素的value設為空白值
.removeAttr(‘checked‘)
.removeAttr(‘selected‘); // 如果任何radio/checkbox/select inputs有checked or selected 屬
alert($(‘input‘,‘#form1‘));
$(‘select‘,‘#form1‘)
.not(‘:button,:submit,:reset,:hidden‘) //將myform表單中input元素type為button、submit、reset、hidden排除
.val(‘‘) //將input元素的value設為空白值
.removeAttr(‘checked‘)
.removeAttr(‘selected‘); // 如果任何radio/checkbox/select inputs有checked or selected 屬
alert($(‘select‘,‘#form1‘));

$(‘textarea‘,‘#form1‘)
.not(‘:button,:submit,:reset,:hidden‘) //將myform表單中input元素type為button、submit、reset、hidden排除
.text("")
.removeAttr(‘checked‘)
.removeAttr(‘selected‘); // 如果任何radio/checkbox/select inputs有checked or selected 屬
alert($(‘textarea ‘,‘#form1‘));
});
});

//刪除群組
function deleteDataall(deletes){
if(null!=deletes&&""!=deletes){
var deletes = deletes +‘&dept_code=${dept_code}&dengluming=${dengluming}&userId=${userId}&flagsString=true‘;
deleteModify(‘removeJob.action‘,‘personIds=‘+deletes);//mian.js
}
}
//儲存返回修改
function saveNew(){
var type=document.getElementById("jobhistory_jobhistory_id").value;
var src="saveJobForAll.action";
if(null!=type && ""!=type){
src="updateJobForAll.action";
}
document.getElementById("form1").action=src;
document.getElementById("form1").submit();
}

</script>

jquery css 簡單筆記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.