67,512
社区成员
发帖
与我相关
我的任务
分享
<button class="btn" name="btnGet" id="btnGet" onclick="clickbtnGet();"><span class="icon icon-ok"> </span>详情</button>
function clickbtnGet(){
alert("参数:");
$.ajax({
url:"/MyStoraneManage/stockIn_ajaxLoad.action";
type:"POST";
data:{id:$("#in_id").val()};
dataType:"json";
success:function(data){alert(data)};
});
}
public String ajaxLoad(){
System.out.println("执行到ajax方法了");
HttpServletRequest request= (HttpServletRequest)ServletActionContext.getRequest();
String id= request.getParameter("id");
this.estockin=stockInManager.queryById(Integer.parseInt(id));//estockin是一个实体类对象
JSONObject js=JSONObject.fromObject(estockin);
result=js.toString();
return "success";
}
function clickbtnGet(id){
alert("参数:"+id);
//$.ajax({
//url:"/MyStoraneManage/stockIn_ajaxLoad.action",
//type:"POST",
//data:{id:id},
//dataType:"json",
//success:function(data){alert(data)}
//});
alert("发送请求);
}
改成这样了,还是不行,警告框也弹不出来
快被搞晕了[/quote]
测试最简的可以 , [/quote]
什么意思??function clickbtnGet(id){
alert("参数:"+id);
//$.ajax({
//url:"/MyStoraneManage/stockIn_ajaxLoad.action",
//type:"POST",
//data:{id:id},
//dataType:"json",
//success:function(data){alert(data)}
//});
alert("发送请求);
}
改成这样了,还是不行,警告框也弹不出来
快被搞晕了[/quote]
把这个onclick 代码也贴出来,[/quote]
我把jsp贴出来,你们帮我看看吧
<script type="text/javascript">
$(document).ready(function(){
Administry.setup();
$("#tabs, #tabs2").tabs();
/* progress bar animations - setting initial values */
Administry.progress("#progress1", 10, 100);
Administry.progress("#progress2", 25, 100);
Administry.progress("#progress3", 50, 100);
/* <video> support for older browsers through flash player embedding */
Administry.videoSupport('video-flash', 'video/video.f4v', 320, 240);
});
function clickbtn(){
alert("参数:");
$.ajax({
url:"/MyStoraneManage/stockIn_ajaxLoad.action",
type:"POST",
data:{id:$('#ck').attr('value')},
dataType:"json",
success:function(data){alert(data)}
});
alert("发送请求);
}
function alert_del() {
var msg = "您真的确定要删除吗?\n\n请确认!";
if (confirm(msg)==true){
return true;
}
else return false;
}
function dictsel(){
window.location.href="/MyStoraneManage/stockIn_page.action";
}
function pgsel(){
document.pgform.submit();
}
function submitform()
{
document.pgform.action="/MyStoraneManage/stockIn_page.action";
document.pgform.submit();
}
//批量删除
function delchecked(){
//函数调用,获取选中id,所组成的字符串
ids = getSelectCheckboxValues();
if(ids !=null && ids != ""){
if(confirm("删除的数据将无法恢复,确认删除?")) {
window.location.href='stockIn_delChecked.action?ids='+ids;
}
}else{
alert("请至少选择一行!");
}
}
//选中id,组成的字符串
function getSelectCheckboxValues(){
//获取名称为ck的checkbox,形成数组
var objArray = document.getElementsByName('ck');
//定义返回结果
var result ='';
for (var i=0;i<objArray.length;i++){
//如果名称为ck的checkbox被选中了,就进行id拼接
if (objArray[i].checked==true){
result += objArray[i].value+",";
}
}
//返回拼接结果,之所以截取到 result.length-1,因为result结果最后一个字符是,
return result.substring(0, result.length-1);
}
//全选
function selAll(){
for(i=0;i<document.pgform.ck.length;i++){
if(!document.pgform.ck[i].checked){
document.pgform.ck[i].checked=true;
}
}
}
//取消
function noSelAll(){
for(i=0;i<document.pgform.ck.length;i++){
if(document.pgform.ck[i].checked){
document.pgform.ck[i].checked=false;
}
}
}
//checkbox选择全部,或不选择
function selectAllOrNo(){
n=n+1;
if(n%2==0){
selAll();
}else{
noSelAll();
}
}
//反选
function selOther(){
for(i=0;i<document.pgform.ck.length;i++){
if(document.pgform.ck[i].checked){
document.pgform.ck[i].checked=false;
}else{
document.pgform.ck[i].checked=true;
}
}
}
</script>
</style>
</head>
<body>
<div id="page">
<!-- Wrapper -->
<div class="wrapper">
<!-- Left column/section -->
<section class="column width6 first">
<h3>所有入库订单列表</h3>
<span class="subtitle">
<form action="stockIn_page.action" method="post" name="pgform">
<table>
<tr>
<th>订单编号</th>
<td><input type="text" name="stockin.inid" value="${stockin.inid}" size="5" /></td>
<th>商品编号</th>
<td><input type="text" name="stockin.gepc" value="${stockin.gepc}" size="10"/></td>
<th>客户编号</th>
<td><input type="text" name="stockin.guestid" value="${stockin.guestid}" size="10"/></td>
<td> <input class="btn btn-red" type="submit" onclick="submitform()"></td>
<td> <input class="btn btn-green" type="reset" onclick="javascript:document.pgform.reset()"></td>
</tr>
</table>
</span>
<hr/>
<table class="stylized full" id="t" >
<thead>
<tr>
<th width="3%">
<input type="checkbox" name="checkbox" id="checkbox" onclick="selectAllOrNo();"/></th>
<th>订单编号</th>
<th>商品编号</th>
<th>商品名称</th>
<th>经手人</th>
<th>客户</th>
<th>数量</th>
<th>是否处理</th>
<th>其他操作</th>
</tr>
</thead>
<c:forEach items="${page.data}" var="stockins" varStatus="c">
<tbody>
<tr onmouseover="this.style.backgroundColor='#FFF68F'" onmouseout="this.style.backgroundColor='#FAFAFA'" >
<td width="3%"><input type="checkbox" name="ck" id="ck" value="${stockins.id}"/></td>
<td><a href="/MyStoraneManage/stockIn_showStockInItemsByinid.action?inid=${stockins.inid}">${stockins.inid}</a></td>
<td>${stockins.gepc}</td>
<td>${stockins.gname}</td>
<td>${stockins.uid}</td>
<td>${stockins.guestid}</td>
<td>${stockins.sumin}</td>
<td>
<c:if test="${stockins.flag==0}">未处理</c:if>
<c:if test="${stockins.flag==1}">已处理</c:if>
</td>
<td>
<c:if test="${stockins.flag==0}">
<a href="/MyStoraneManage/stockIn_delStockInId.action?id=${stockins.id}" class="btn" onclick="javascript:return alert_del()"><span class="icon icon-cancel"> </span>删除</a>
<a href="/MyStoraneManage/stockIn_getOneStockIn.action?id=${stockins.id}" class="btn"><span class="icon icon-add"> </span>编辑</a>
</c:if>
<c:if test="${stockins.flag==1}">
<button class="btn" onclick="clickbtn();"><span class="icon icon-ok"> </span>详情</button>
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
<tfoot>
<tr>
<td colspan="9">
<div class="pager">
共<font color="blue">${page.totalcount}</font>条记录 每页<input value="${page.pagesize}" size="2" name="pSize" />条
第<font color="blue">${page.currentPage}</font>页/共<font color="blue">${page.totalPage}</font>页
<a href="stockIn_page.action?pnum=1&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}">第一页</a>
<a href="stockIn_page.action?pnum=${page.prePage}&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}" >上一页</a>
<a href="stockIn_page.action?pnum=${page.nextPage}&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}" >下一页</a>
<a href="stockIn_page.action?pnum=${page.totalPage}&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}" >最后一页</a>
转到<input name="pnum" value="${page.currentPage}" id="pnum" size="2" />
<button onclick="pgsel();" type="submit">GO</button>
</div>
</form>
</td>
</tr>
</tfoot>
</table>
<span class="subtitle">
<input class="btn btn-red" type="button" value="全选" onclick="selAll();"/>
<input class="btn btn-green" type="button" value="反选" onclick="selOther();"/>
<input class="btn btn-blue" type="button" value="取消" onclick="noSelAll();"/>
<input class="btn btn-red" type="button" value="删除" onclick="delchecked();"/>
<input class="btn btn-green" type="button" value="增加" onclick="selOther();"/>
</span>
<hr/>
[/quote]
测试最简的可以 , function clickbtnGet(id){
alert("参数:"+id);
//$.ajax({
//url:"/MyStoraneManage/stockIn_ajaxLoad.action",
//type:"POST",
//data:{id:id},
//dataType:"json",
//success:function(data){alert(data)}
//});
alert("发送请求);
}
改成这样了,还是不行,警告框也弹不出来
快被搞晕了[/quote]
把这个onclick 代码也贴出来,[/quote]
我把jsp贴出来,你们帮我看看吧
<script type="text/javascript">
$(document).ready(function(){
Administry.setup();
$("#tabs, #tabs2").tabs();
/* progress bar animations - setting initial values */
Administry.progress("#progress1", 10, 100);
Administry.progress("#progress2", 25, 100);
Administry.progress("#progress3", 50, 100);
/* <video> support for older browsers through flash player embedding */
Administry.videoSupport('video-flash', 'video/video.f4v', 320, 240);
});
function clickbtn(){
alert("参数:");
$.ajax({
url:"/MyStoraneManage/stockIn_ajaxLoad.action",
type:"POST",
data:{id:$('#ck').attr('value')},
dataType:"json",
success:function(data){alert(data)}
});
alert("发送请求);
}
function alert_del() {
var msg = "您真的确定要删除吗?\n\n请确认!";
if (confirm(msg)==true){
return true;
}
else return false;
}
function dictsel(){
window.location.href="/MyStoraneManage/stockIn_page.action";
}
function pgsel(){
document.pgform.submit();
}
function submitform()
{
document.pgform.action="/MyStoraneManage/stockIn_page.action";
document.pgform.submit();
}
//批量删除
function delchecked(){
//函数调用,获取选中id,所组成的字符串
ids = getSelectCheckboxValues();
if(ids !=null && ids != ""){
if(confirm("删除的数据将无法恢复,确认删除?")) {
window.location.href='stockIn_delChecked.action?ids='+ids;
}
}else{
alert("请至少选择一行!");
}
}
//选中id,组成的字符串
function getSelectCheckboxValues(){
//获取名称为ck的checkbox,形成数组
var objArray = document.getElementsByName('ck');
//定义返回结果
var result ='';
for (var i=0;i<objArray.length;i++){
//如果名称为ck的checkbox被选中了,就进行id拼接
if (objArray[i].checked==true){
result += objArray[i].value+",";
}
}
//返回拼接结果,之所以截取到 result.length-1,因为result结果最后一个字符是,
return result.substring(0, result.length-1);
}
//全选
function selAll(){
for(i=0;i<document.pgform.ck.length;i++){
if(!document.pgform.ck[i].checked){
document.pgform.ck[i].checked=true;
}
}
}
//取消
function noSelAll(){
for(i=0;i<document.pgform.ck.length;i++){
if(document.pgform.ck[i].checked){
document.pgform.ck[i].checked=false;
}
}
}
//checkbox选择全部,或不选择
function selectAllOrNo(){
n=n+1;
if(n%2==0){
selAll();
}else{
noSelAll();
}
}
//反选
function selOther(){
for(i=0;i<document.pgform.ck.length;i++){
if(document.pgform.ck[i].checked){
document.pgform.ck[i].checked=false;
}else{
document.pgform.ck[i].checked=true;
}
}
}
</script>
</style>
</head>
<body>
<div id="page">
<!-- Wrapper -->
<div class="wrapper">
<!-- Left column/section -->
<section class="column width6 first">
<h3>所有入库订单列表</h3>
<span class="subtitle">
<form action="stockIn_page.action" method="post" name="pgform">
<table>
<tr>
<th>订单编号</th>
<td><input type="text" name="stockin.inid" value="${stockin.inid}" size="5" /></td>
<th>商品编号</th>
<td><input type="text" name="stockin.gepc" value="${stockin.gepc}" size="10"/></td>
<th>客户编号</th>
<td><input type="text" name="stockin.guestid" value="${stockin.guestid}" size="10"/></td>
<td> <input class="btn btn-red" type="submit" onclick="submitform()"></td>
<td> <input class="btn btn-green" type="reset" onclick="javascript:document.pgform.reset()"></td>
</tr>
</table>
</span>
<hr/>
<table class="stylized full" id="t" >
<thead>
<tr>
<th width="3%">
<input type="checkbox" name="checkbox" id="checkbox" onclick="selectAllOrNo();"/></th>
<th>订单编号</th>
<th>商品编号</th>
<th>商品名称</th>
<th>经手人</th>
<th>客户</th>
<th>数量</th>
<th>是否处理</th>
<th>其他操作</th>
</tr>
</thead>
<c:forEach items="${page.data}" var="stockins" varStatus="c">
<tbody>
<tr onmouseover="this.style.backgroundColor='#FFF68F'" onmouseout="this.style.backgroundColor='#FAFAFA'" >
<td width="3%"><input type="checkbox" name="ck" id="ck" value="${stockins.id}"/></td>
<td><a href="/MyStoraneManage/stockIn_showStockInItemsByinid.action?inid=${stockins.inid}">${stockins.inid}</a></td>
<td>${stockins.gepc}</td>
<td>${stockins.gname}</td>
<td>${stockins.uid}</td>
<td>${stockins.guestid}</td>
<td>${stockins.sumin}</td>
<td>
<c:if test="${stockins.flag==0}">未处理</c:if>
<c:if test="${stockins.flag==1}">已处理</c:if>
</td>
<td>
<c:if test="${stockins.flag==0}">
<a href="/MyStoraneManage/stockIn_delStockInId.action?id=${stockins.id}" class="btn" onclick="javascript:return alert_del()"><span class="icon icon-cancel"> </span>删除</a>
<a href="/MyStoraneManage/stockIn_getOneStockIn.action?id=${stockins.id}" class="btn"><span class="icon icon-add"> </span>编辑</a>
</c:if>
<c:if test="${stockins.flag==1}">
<button class="btn" onclick="clickbtn();"><span class="icon icon-ok"> </span>详情</button>
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
<tfoot>
<tr>
<td colspan="9">
<div class="pager">
共<font color="blue">${page.totalcount}</font>条记录 每页<input value="${page.pagesize}" size="2" name="pSize" />条
第<font color="blue">${page.currentPage}</font>页/共<font color="blue">${page.totalPage}</font>页
<a href="stockIn_page.action?pnum=1&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}">第一页</a>
<a href="stockIn_page.action?pnum=${page.prePage}&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}" >上一页</a>
<a href="stockIn_page.action?pnum=${page.nextPage}&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}" >下一页</a>
<a href="stockIn_page.action?pnum=${page.totalPage}&pSize=${page.pagesize}&stockin.inid=${stockin.inid}&stockin.gepc=${stockin.gepc}&stockin.guestid=${stockin.guestid}" >最后一页</a>
转到<input name="pnum" value="${page.currentPage}" id="pnum" size="2" />
<button onclick="pgsel();" type="submit">GO</button>
</div>
</form>
</td>
</tr>
</tfoot>
</table>
<span class="subtitle">
<input class="btn btn-red" type="button" value="全选" onclick="selAll();"/>
<input class="btn btn-green" type="button" value="反选" onclick="selOther();"/>
<input class="btn btn-blue" type="button" value="取消" onclick="noSelAll();"/>
<input class="btn btn-red" type="button" value="删除" onclick="delchecked();"/>
<input class="btn btn-green" type="button" value="增加" onclick="selOther();"/>
</span>
<hr/>
function clickbtnGet(id){
alert("参数:"+id);
//$.ajax({
//url:"/MyStoraneManage/stockIn_ajaxLoad.action",
//type:"POST",
//data:{id:id},
//dataType:"json",
//success:function(data){alert(data)}
//});
alert("发送请求);
}
改成这样了,还是不行,警告框也弹不出来
快被搞晕了[/quote]
把这个onclick 代码也贴出来,