主要是这几个增删改查按钮事件不知道该怎么触发实现,因为这页面都是用Angularjs、bootstrap JS插件实现的
下面是点击添加按钮时弹出的form表单:
这里是我的jsp页面代码:
<jsp:include page="../include/page.jsp"/>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html ng-app>
<head>
<link href="../ace/assets/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="../ace/assets/css/font-awesome.min.css"/>
<!--[if IE 7]>
<link rel="stylesheet" href="../ace/assets/css/font-awesome-ie7.min.css"/>
<![endif]-->
<!-- page specific plugin styles -->
<link rel="stylesheet" href="../ace/assets/css/jquery-ui-1.10.3.full.min.css"/>
<link rel="stylesheet" href="../ace/assets/css/datepicker.css"/>
<link rel="stylesheet" href="../ace/assets/css/ui.jqgrid.css"/>
<!-- fonts -->
<link rel="stylesheet" href="http://fonts.useso.com/css?family=Open+Sans:400,300"/>
<!-- ace styles -->
<link rel="stylesheet" href="../ace/assets/css/ace.min.css"/>
<link rel="stylesheet" href="../ace/assets/css/ace-rtl.min.css"/>
<link rel="stylesheet" href="../ace/assets/css/ace-skins.min.css"/>
<!--[if lte IE 8]>
<link rel="stylesheet" href="../ace/assets/css/ace-ie.min.css"/>
<![endif]-->
<!-- inline styles related to this page -->
<!-- ace settings handler -->
<script src="../ace/assets/js/ace-extra.min.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../ace/assets/js/html5shiv.js"></script>
<script src="../ace/assets/js/respond.min.js"></script>
<![endif]-->
<jsp:include page="../include/head.jsp"/>
<script src="UserMsg.js"></script>
</head>
<body >
<div class="main-container" ng-controller="UserMsgController">
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<!-- PAGE CONTENT BEGINS -->
<table id="grid-table"></table>
<div id="grid-pager"></div>
<script type="text/javascript">
var $path_base = "/";//this will be used in gritter alerts containing images
</script>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</div>
<script src="http://ajax.useso.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!-- <![endif]-->
<!--[if IE]>
<script src="http://ajax.useso.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<![endif]-->
<!--[if !IE]> -->
<script type="text/javascript">
window.jQuery || document.write("<script src='../ace/assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
window.jQuery || document.write("<script src='../ace/assets/js/jquery-1.10.2.min.js'>" + "<" + "/script>");
</script>
<![endif]-->
<script type="text/javascript">
if ("ontouchend" in document) document.write("<script src='../ace/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="../ace/assets/js/bootstrap.min.js"></script>
<script src="../ace/assets/js/typeahead-bs2.min.js"></script>
<!-- page specific plugin scripts -->
<script src="../ace/assets/js/date-time/bootstrap-datepicker.min.js"></script>
<script src="../ace/assets/js/jqGrid/jquery.jqGrid.min.js"></script>
<script src="../ace/assets/js/jqGrid/i18n/grid.locale-en.js"></script>
<!-- ace scripts -->
<script src="../ace/assets/js/ace-elements.min.js"></script>
<script src="../ace/assets/js/ace.min.js"></script>
<!-- inline scripts related to this page -->
<div style="display:none">
<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
</div>
</body>
</html>
下面是我的一部分js代码:
/**
* Created by zhouzhiming on 14-8-12.
*/
function UserMsgController() {
//alert(1);
showUser();
//alert(1);
};
var showUser=function(){
jQuery(function ($) {
var grid_selector = "#grid-table";
var pager_selector = "#grid-pager";
//alert(3);
jQuery(grid_selector).jqGrid({
url: "../table/UserMsg/ShowAllUsers.do",
datatype: "json",
mtype:"POST",
height: 300,
colNames: ['用户ID', '管理机构编码', '用户编码', '用户口令', '用户姓名', 'Email', '用户描述', '用户状态', '操作员', '有效开始日期', '有效结束日期', '入机日期', '最后修改日期'],
colModel: [
{name: 'userId', index: 'userId', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name: 'lDCom.comCode',index:'lDCom.comCode',width:90, editable: true,edittype:"select",editoptions:{value:"86:86"}},
{name: 'userCode', index: 'userCode', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name: 'password', index: 'password', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name: 'userName', index: 'userName', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name: 'email', index: 'email', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name: 'userDescription', index: 'userDescription', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name:'userState',index:'userState',width:90, editable: true,edittype:"select",editoptions:{value:"1:1;0:0"}},
{name: 'operator', index: 'operator', width: 90, editable: true, editoptions: {size: "20", maxlength: "30"}},
{name: 'validStartDate', index: 'validStartDate', width: 150, editable: true, sorttype: "date", unformat: pickDate},
{name: 'validEndDate', index: 'validEndDate', width: 150, editable: true, sorttype: "date", unformat: pickDate},
{name: 'makeDate', index: 'makeDate', width: 150, editable: true, sorttype: "date", unformat: pickDate},
{name: 'modifyDate', index: 'modifyDate', width: 150, editable: true, sorttype: "date", unformat: pickDate}
],
viewrecords: true,
rowNum: 10,
rowList: [10, 20, 30],
pager: pager_selector,
altRows: true,
multiselect: true,
multiboxonly: true,
editurl: $path_base + "/dummy.html",//nothing is saved
caption: "用户信息显示",
autowidth: true
});
//enable datepicker
function pickDate(cellvalue, options, cell) {
setTimeout(function () {
$(cell).find('input[type=text]')
.datepicker({format: 'yyyy-mm-dd', autoclose: true});
}, 0);
}
//navButtons
jQuery(grid_selector).jqGrid('navGrid', pager_selector,
{ //navbar options
edit: true,
editicon: 'icon-pencil blue',
add: true,
addicon: 'icon-plus-sign purple',
del: true,
delicon: 'icon-trash red',
search: true,
searchicon: 'icon-search orange'
//addfunc : openDialogAdding
/*bSubmit : function(){
alert(1);
}*/
}
)
/**
* 获取当前选中的行号
*/
var echoSelRow = function() {
var id = $(grid_selector).jqGrid("getGridParam", "selrow");
alert("当前选中行ID:" + id);
};
$("#sData").click(function(){
alert(1);
});
})
};
我的数据是用后台action获取的数据,以json格式转换传到页面表格上的,其中有一个问题是如果我一个用户里包含了一个对象,但是我要把这个对象中的一个数据显示在表格里该怎么实现
还有就是我点击添加按钮式该触发那个事件,我一直找不到submit提交时到底是走到哪去了,
这里我获取不到对象数据,怎么回事呢??
如果有哪位大神有已经做过类似的实现增删改查,小弟感激不尽啊
17 个解决方案
#1
如果有哪位大神有已经做过类似的实现增删改查,可以发到我的邮箱,zzm5010@163.com
谢谢了!!
谢谢了!!
#2
<!-- inline scripts related to this page -->
<div style="display:none">
<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
<div style="display:none">
<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
#3
楼主知道了可以发给我参考一下么?非常感谢!704368330@qq.com
#4
同样需要 346861363@qq.com
#5
同样需要 346861363@qq.com ,谢谢
#6
同样需要 346861363@qq.com ,谢谢
#7
同样需要1685864592@qq.com
#8
同样需要364334016@qq.com
#9
给我也来一份吧,905921434@qq.com
#10
能给我发一份吗,万分感谢
#11
1368865240@qq.com
#12
1027523892@qq.com 楼主是好人
#13
楼主可以了吗,求个代码408353186@qq.com,感激不尽
#14
楼主可以了吗,求个代码376136853@qq.com,感激不尽
#15
758400146@qq.com这里也需要,谢谢
#16
楼主好人 同样需要 120974822@qq.com
#17
同楼上,先谢谢楼主 1072722940@qq.com
不知道怎么后台php代码对接
不知道怎么后台php代码对接
#1
如果有哪位大神有已经做过类似的实现增删改查,可以发到我的邮箱,zzm5010@163.com
谢谢了!!
谢谢了!!
#2
<!-- inline scripts related to this page -->
<div style="display:none">
<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
<div style="display:none">
<script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script>
#3
楼主知道了可以发给我参考一下么?非常感谢!704368330@qq.com
#4
同样需要 346861363@qq.com
#5
同样需要 346861363@qq.com ,谢谢
#6
同样需要 346861363@qq.com ,谢谢
#7
同样需要1685864592@qq.com
#8
同样需要364334016@qq.com
#9
给我也来一份吧,905921434@qq.com
#10
能给我发一份吗,万分感谢
#11
1368865240@qq.com
#12
1027523892@qq.com 楼主是好人
#13
楼主可以了吗,求个代码408353186@qq.com,感激不尽
#14
楼主可以了吗,求个代码376136853@qq.com,感激不尽
#15
758400146@qq.com这里也需要,谢谢
#16
楼主好人 同样需要 120974822@qq.com
#17
同楼上,先谢谢楼主 1072722940@qq.com
不知道怎么后台php代码对接
不知道怎么后台php代码对接