easyui的searchbox问题
最近刚接触这个控件感觉很不错,但是我不知道怎么用这个控件,我想用这个控件做个表格的条件查询,试了几次发现不行,请教各位大神。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="/backweb/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/backweb/js/jquery.easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/backweb/js/jquery.easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" type="text/css" href="/backweb/css/jquery.easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="/backweb/css/jquery.easyui/themes/default/easyui.css" />
<script type="text/javascript">
$(function () {
$("#dg").datagrid({
url: "sqb_bweb_notice_main.aspx?mode=1"
});
$("#serch").searchbox({
searcher: function (value, name) {
// $.ajax({
// type: "post",
// url: "sqb_bweb_notice_main.aspx",
// data: {mode:"dddd"}
// });
// alert(value + ";" + name);
// var id = dg.id;
// var objs;
// if (id != " ") {
// var objs = dg.children;
// }
// document.getElementById(" <%=TextBox1.ClientID%> ").value = dg[1].innerText;
// document.getElementById(" <%=TextBox2.ClientID%> ").value = dg[2].innerText;
}
});
})
function serch_onclick() {
$.ajax({
type: "post",
url: "sqb_bweb_notice_main.aspx",
data: {mode:"dddd"}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="notice" title="新闻管理" style="width:100%;height:100%;">
<table id="dg" class="easyui-datagrid" style="width:778px;height:574px" url: "sqb_bweb_notice_main.aspx" fitColumns="true" rownumbers="true" toolbar="#tb" singleselect="true">
<thead>
<tr>
<th field="Title" width="140">标题</th>
<th field="Notice_Content" width="80">内容摘要</th>
<th field="Notice_Type" width="60">新闻类型</th>
<th field="Date" width="140" align="right">发布时间</th>
<th field="Active_Time" width="180" align="right">有效日期</th>
<th field="Add_User" width="60">发布人</th>
</tr>
</thead>
<div id="tb">
<a class="easyui-linkbutton" iconCls="icon-add" plain="true" id="add" href="sqb_bweb_notice_main.aspx" target="_self" >新增</a>
<a class="easyui-linkbutton" iconCls="icon-cut" plain="true" id="del" onclick="del()">删除</a>
<a class="easyui-linkbutton" iconCls="icon-edit" plain="true" id="edit" onclick="edit()">修改</a>
<input id="serch" class="easyui-searchbox" data-options="prompt:'Please Input Value',menu:'#mm'" style="width:300px" runat="server" onclick="return serch_onclick()" />
<%--<div id="search" onclick="search"></div>'#search'--------- --%>
<div id="mm" style="width:120px">
<div data-options="Title:'Title',iconCls:'icon-ok'">标题</div>
<div data-options="Notice_Type:'Notice_Type'">新闻类型</div>
<div data-options="Add_User_Name:'Add_User_Name'">发布人</div>
</div>
</div>
</table>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
[解决办法]
看看介个
[解决办法]
后台加载控件选择项写在 if (!IsPostBack)
{
}这内
[解决办法]
不行,不行在哪? 帖一大段代码让人找?