///<reference path="jquery-180minjs" />
//加载函数
$(function () {
Nbookload();
});
var Nbook =
{
load: function () {
Nbookclci();
},
selectDat: function () {
var val;
$ajax({
type: "post",
dataType: "json",
data: { "method": "selectData", "Name": "'" + $trim($("#Name")val())+"'" },
url: "ashx/testashx",
success: function (data) {
if (data != null) {
var html = "";
val = eval(data);
//consolelog(booklength);
//for (var i = 0; i < booklength; i++) {
// html += "<ul class='main_Ul'><li>" + book[i]name + "</li><li>" + book[i]sch_id + "</li><li>" + book[i]sex + "</li><li>" + book[i]isOk + "</li></ul>";
//}
//$("main")html(html);
layuiuse('table', function () {
var table = layuitable;
//展示已知数据
tablerender({
elem: '#socialList'
, cols: [[ //表头
{ type: 'checkbox', fixed: 'left' },
{ field: 'name', title: '姓名', sort: true, fixed: 'left', unresize: true, sort: true, totalRowText: '合计' }
, { field: 'sch_id', title: '学校ID', sort: true, totalRow: true }
, { field: 'sex', title: '性别', sort: true, totalRow: true }
, { field: 'isOk', title: '是否OK' }
]],
data: val
, even: true
, page: true //是否显示分页
, toolbar: true //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
, limits: [3, 5, 7, 8, 10, 50]
, limit: 8 //每页默认显示的数量
, cellMinWidth: 80
, height: 'full-515'//设置表格最大高度
, totalRow: true//开启合计
});
});
}
}
});
},
clci: function ()
{
if ($trim($("#Name")val()) == "")
{
NbookselectDat();
}
$("input[type='button']")click(function () {
NbookselectDat();
});
}
}
页面如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="myselectaspxcs" Inherits="WebTestDemosmyselect" %>
<!DOCTYPE html>
<html xmlns=">
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)