easyui下拉框问题

黑猫警长-- 2012-04-09 03:57:55
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
System.out.println(basePath);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>副仓库管理</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<base href="<%=basePath%>">
</head>
<link href="css/index.css" type=text/css rel=stylesheet></link>
<link href="css/MasterPage.css" type=text/css rel=stylesheet></link>
<link rel="stylesheet" type="text/css" href="js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="js/easyui/themes/icon.css">
<script type="text/javascript" src="js/easyui/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui/locale/easyui-lang-zh_CN.js"></script>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
<!--
.text {
background:url(Images/login_6.gif) repeat-x; border:solid 1px #27B3FE; height:20px; background-color:#FFFFFF;
}
-->
</style>
<script>
$(function(){
$('#test').datagrid({
title:'副仓库管理',
iconCls:'icon-save',
width:800,
height:500,
nowrap: false,
striped: true,
collapsible:true,
resizeable:true,
url:'<%=basePath%>jc_WarehouseinfoAction$findAllJcWarehouseInfo',
sortName:'code',
sortOrder: 'desc',
remoteSort: false,
singleSelect:true,
pageSize:20,
idField:'id',
loadMsg:"正在加载数据……",
columns:[[
{title:'仓库编码',field:'jwi_Id',width:60,sortable:true},
{title:'仓库名称',field:'jwi_Name',width:80},
{title:'创建时间',field:'jwi_Createtime',width:80},
{title:'所在楼层',field:'jwi_Floor',width:60},
{title:'仓库面积',field:'jwi_Allspace',width:80},
{title:'主仓库',field:'jc_Bigwarehouse',width:80},
{title:'仓库分区数',field:'jwi_Partitionnum',width:80},
{title:'负责人',field:'jwi_Head',width:60}
]],
pagination:true,
rownumbers:true,
toolbar:[{
id:'btnadd',
text:'添加',
iconCls:'icon-add',
handler:function(){
document.uploadform("jwi_Id").value="";
document.uploadform("jwi_Name").value="";
document.uploadform("jwi_Floor").value="";
document.uploadform("jwi_Allspace").value="";
document.uploadform("jwi_Partitionnum").value="";
document.uploadform("jwi_Head").value="";
$("#add").window("open");
}
},{
id:'btncut',
text:'修改',
iconCls:'icon-cut',
handler:function(){
var selected = $('#test').datagrid('getSelected');
if(selected){
document.uploadform("jwi_Id").value=selected.jwi_Id;
document.uploadform("jwi_Name").value=selected.jwi_Name;
document.uploadform("jwi_Allspace").value=selected.jwi_Allspace;
document.uploadform("jwi_Floor").value=selected.jwi_Allspace;
document.uploadform("jwi_Partitionnum").value=selected.jwi_Partitionnum;
document.uploadform("jwi_Head").value=selected.jwi_Head;
$("#add").window("open");
}
}
},{
id:'btndelete',
text:'删除',
disabled:false,
iconCls:'icon-remove',
handler:function(){
var selected = $('#test').datagrid('getSelected');
$.messager.confirm('系统提示', '您确定要删除此条记录吗?', function(btn) {
if (btn){
window.location="<%=basePath%>jc_WarehouseinfoAction$delAllJcWarehouseInfo$ccmanager?jwi_Id="+selected.jwi_Id;
}
});
}
},'-',{
id:'btnSearch',
text:'查询',
disabled:false,
iconCls:'icon-search',
handler:function(){
$("#query").window("open");
}
}]
});
});
$(function(){
$('#cc').combobox({
url:'<%=basePath%>jc_WarehouseinfoAction$findAllJcWarehouseInfo',
valueField:'jwi_Id',
textField:'jwi_Name'
});
});
function reloadTable(){
$('#test').datagrid('options').queryParams={"jwiid":encodeURIComponent($("#jwiid").val()),"jwiname":encodeURIComponent($("#jwiname").val())};
$("#test").datagrid('reload');
$("#query").window("close");
}
function closeTable(){
$("#query").window("close");
$("#add").window("close");
}
function addTable(){
if(document.uploadform("jwi_Name").value==""){alert("仓库名称不能为空!");return;}
if(document.uploadform("jwi_Floor").value==""){alert("仓库楼层数不能为空!");return;}
if(document.uploadform("jwi_Allspace").value==""){alert("仓库面积不能为空!");return;}
if(document.uploadform("jwi_partitionnum").value==""){alert("仓库分区数不能为空!");return;}
if(document.uploadform("jwi_head").value==""){alert("负责人不能为空!");return;}
document.uploadform.submit();
}
</script>
</head>
<body>
<div id="query" class="easyui-window" title="查询" closed="true" collapsible="true" minimizable="false" maximizable="false" resizable="false" modal="true" style="width:300px;height:200px;">
<form id="loadform" name="loadform" method="post" style="padding:10px 20px 10px 40px;">
<p>仓库编码: <input id="jwiid" name="jwiid" class="text" type="text"></p>
<p>仓库名称: <input id="jwiname" name="jwiname" type="text" class="text"></p>
<div style="padding:5px;text-align:center;">
<a href="javascript:reloadTable()" class="easyui-linkbutton" icon="icon-ok">查询</a>
<a href="javascript:closeTable()" class="easyui-linkbutton" icon="icon-cancel">关闭</a>
</div>
</form>
</div>
<div id="add" class="easyui-window" title="添加" closed="true" collapsible="true" minimizable="false" maximizable="false" resizable="false" modal="true" style="width:300px;height:320px;">
<form id="uploadform" name="uploadform" action="<%=basePath%>jc_WarehouseinfoAction$addJcWarehouseInfo$ccmanager" method="post" style="padding:10px 20px 10px 40px;">
<input type="hidden" id="jwi_Id" name="jwi_Id">
<p>仓库名称: <input type="text" id="jwi_Name" name="jwi_Name" class="text"></p>
<p>所属楼层: <input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,'')) type="text" id="jwi_Floor" name="jwi_Floor" class="text"></p>
<p>仓库面积: <input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,'')) type="text" id="jwi_Allspace" name="jwi_Allspace" class="text"></p>
<p>所属主仓: <select id="cc" name="cc"></select></p>
<p>分 区 数: <input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,'')) type="text" id="jwi_partitionnum" name="jwi_partitionnum" class="text"></p>
<p>负 责 人: <input type="text" id="jwi_head" name="jwi_head" class="text"></p>
<div style="padding:5px;text-align:center;">
<a href="javascript:addTable()" class="easyui-linkbutton" icon="icon-ok">保存</a>
<a href="javascript:closeTable()" class="easyui-linkbutton" icon="icon-cancel">取消</a>
</div>
</form>
</div>
<table id="test" align="center"></table>

</body>
</html>
最下边 我定义了一个下拉框 <p>所属主仓: <select id="cc" name="cc"></select></p>
js :$(function(){
$('#cc').combobox({
url:'<%=basePath%>jc_WarehouseinfoAction$findAllJcWarehouseInfo',
valueField:'jwi_Id',
textField:'jwi_Name'
});
});
这个页面加载的时候生成一个datagrid 我点击添加的时候 弹出框里边有这个下拉框 现在问题是 木有走进那个url指定的后台 我先用的当前加载页面的那个url测试 大家帮我看看 第一次使用easyui
...全文
456 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧