亚洲精品久久久久久第一页-人妻少妇精彩视品一区二区三区-91国产自拍免费视频-免费一级a在线播放视频正片-少妇天天日天天射天天爽-国产大屁股喷水视频在线观看-操美女骚穴抽插性爱视频-亚洲 欧美 中文字幕 丝袜-成人免费无码片在线观看

easyui實(shí)現(xiàn)表格分頁操作 easyui分頁查詢


easyui實(shí)現(xiàn)表格分頁操作 easyui分頁查詢

文章插圖
本教程展示如何在帶有動(dòng)態(tài)加載特性的樹網(wǎng)格中添加分頁 。
創(chuàng)建樹網(wǎng)格想要啟動(dòng)樹網(wǎng)格的分頁功能,首先必須添加 ‘pagination:true’ 屬性,這樣頁面加載時(shí)就會(huì)向服務(wù)器發(fā)送 ‘page’ 和 ‘rows’ 參數(shù) 。
NameQuantityPriceTotal服務(wù)器代碼treegrid4_getdata.php
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;$offset = ($page-1)*$rows;$id = isset($_POST['id']) ? intval($_POST['id']) : 0;include 'conn.php';$result = array;if ($id == 0){$rs = mysql_query("select count(*) from products where parentId=0");$row = mysql_fetch_row($rs);$result["total"] = $row[0];$rs = mysql_query("select * from products where parentId=0 limit $offset,$rows");$items = array;while($row = mysql_fetch_array($rs)){$row['state'] = has_child($row['id']) ? 'closed' : 'open';array_push($items, $row);}$result["rows"] = $items;} else {$rs = mysql_query("select * from products where parentId=$id");while($row = mysql_fetch_array($rs)){$row['state'] = has_child($row['id']) ? 'closed' : 'open';$row['total'] = $row['price']*$row['quantity'];array_push($result, $row);}}echo json_encode($result);function has_child($id){$rs = mysql_query("select count(*) from products where parentId=$id");$row = mysql_fetch_array($rs);return $row[0] > 0 ? true : false;}發(fā)送到服務(wù)器的參數(shù)包括:
當(dāng)展開一個(gè)行節(jié)點(diǎn)時(shí),’id’ 值是大于 0 的 。當(dāng)改變頁碼時(shí),’id’ 值應(yīng)該被設(shè)置為 0 來放置加載子行 。


    以上關(guān)于本文的內(nèi)容,僅作參考!溫馨提示:如遇健康、疾病相關(guān)的問題,請您及時(shí)就醫(yī)或請專業(yè)人士給予相關(guān)指導(dǎo)!

    「愛刨根生活網(wǎng)」www.malaban59.cn小編還為您精選了以下內(nèi)容,希望對您有所幫助: