日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

中國最全I(xiàn)T社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2

jqueryeasyui教程

jQuery EasyUI 教程

jEasyUI 應(yīng)用

jEasyUI 拖放

jEasyUI 菜單與按鈕

jEasyUI 布局

jEasyUI 數(shù)據(jù)網(wǎng)格

jEasyUI 窗口

jEasyUI 樹形菜單

jEasyUI 表單

jEasyUI 參考手冊

jQuery EasyUI 數(shù)據(jù)網(wǎng)格 – 添加查詢功能

閱讀 (2236)

jQuery EasyUI 數(shù)據(jù)網(wǎng)格 - 添加查詢功能

本實例演示如何從數(shù)據(jù)庫得到數(shù)據(jù),并將它們顯示在數(shù)據(jù)網(wǎng)格(datagrid)中。然后演示如何根據(jù)用戶輸入的搜索關(guān)鍵詞搜尋顯示結(jié)果。

創(chuàng)建數(shù)據(jù)網(wǎng)格(DataGrid)

創(chuàng)建帶有分頁功能的數(shù)據(jù)網(wǎng)格(datagrid),然后添加工具欄到其中。

	<table id="tt" class="easyui-datagrid" style="width:600px;height:250px" 			url="datagrid24_getdata.php" toolbar="#tb" 			title="Load Data" iconCls="icon-save" 			rownumbers="true" pagination="true">
		<thead>
			<tr>
				<th field="itemid" width="80">Item ID</th>
				<th field="productid" width="80">Product ID</th>
				<th field="listprice" width="80" align="right">List Price</th>
				<th field="unitcost" width="80" align="right">Unit Cost</th>
				<th field="attr1" width="150">Attribute</th>
				<th field="status" width="60" align="center">Stauts</th>
			</tr>
		</thead>
	</table>

工具欄定義如下:

	<div id="tb" style="padding:3px">
		<span>Item ID:</span>
		<input id="itemid" style="line-height:26px;border:1px solid #ccc">
		<span>Product ID:</span>
		<input id="productid" style="line-height:26px;border:1px solid #ccc">
		<a href="#" class="easyui-linkbutton" plain="true" onclick="doSearch()">Search</a>
	</div>

當(dāng)用戶輸入查詢值并按下查詢按鈕時,'doSearch' 函數(shù)將被調(diào)用:

	function doSearch(){
		$('#tt').datagrid('load',{
			itemid: $('#itemid').val(),
			productid: $('#productid').val()
		});
	}

上面的代碼調(diào)用了 'load' 方法來加載新的數(shù)據(jù)網(wǎng)格(datagrid)數(shù)據(jù)。我們需要傳遞 'itemid' 和 'productid' 參數(shù)到服務(wù)器。

服務(wù)器端代碼

	include 'conn.php';
	
	$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
	$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
	$itemid = isset($_POST['itemid']) ? mysql_real_escape_string($_POST['itemid']) : '';
	$productid = isset($_POST['productid']) ? mysql_real_escape_string($_POST['productid']) : '';
	
	$offset = ($page-1)*$rows;
	
	$result = array();
	
	$where = "itemid like '$itemid%' and productid like '$productid%'";
	$rs = mysql_query("select count(*) from item where " . $where);
	$row = mysql_fetch_row($rs);
	$result["total"] = $row[0];
	
	$rs = mysql_query("select * from item where " . $where . " limit $offset,$rows");
	
	$items = array();
	while($row = mysql_fetch_object($rs)){
		array_push($items, $row);
	}
	$result["rows"] = $items;
	
	echo json_encode($result);

下載 jQuery EasyUI 實例

jeasyui-datagrid-datagrid24.zip

關(guān)閉
程序員人生
主站蜘蛛池模板: 亚洲第一天堂无码专区 | 亚洲va中文字幕 | 午夜在线免费观看 | 中文二区 | 国产一区二区三区免费观看在线 | 91网站视频在线观看 | 欧美一a一片一级一片 | 视频精品久久 | 国产精品免费视频观看 | 国产激情在线观看 | 日韩三级在线 | 网曝91综合精品门事件在线 | 青青草国产成人av片免费 | 91精品国产91久久综合桃花 | 亚洲第一黄色网 | 欧美精品在线一区二区 | 久久久久久久久国产 | 久久久久久久久国产 | 日韩一页 | 天天爱天天操 | 国产精品66 | 一级毛片一级毛片一级毛片 | 久久国产福利 | 亚洲精品一区二区 | 亚洲精品久久久蜜桃 | 日韩中文字幕电影 | 中文字幕亚洲精品 | 亚洲精品免费视频 | 亚洲福利一区二区三区 | 久久亚洲精品小早川怜子66 | 国产精品美女久久久 | 成人午夜在线观看 | 亚洲免费精品 | 99视频一区二区 | 91精品国产乱码久久久久久久久 | 国内自拍中文字幕 | 日韩 国产 欧美 | 国产欧美一区二区三区在线看 | 福利视频一区二区三区 | 亚洲综合中文 | 精品在线一区二区三区 |