使用B-JUI 1.31版本

DataGrid 页直接上代码:

<div class="bjui-pageHeader" style="background-color: #fefefe; border-bottom: none;">
<form data-toggle="ajaxsearch" id="findglobalform" data-options="{searchDatagrid:$.CurrentNavtab.find('#datagrid-globals')}">
<fieldset>
<legend style="font-weight:normal;">搜索:</legend>
<div style="margin:0; padding:1px 5px 5px;">
<span>姓名全拼:</span>
<input name="pinyin" size="10">&nbsp;
<span>性别:</span>
<select name="sex">
<option value="">全部</option>
<option value="M">男</option>
<option value="F">女</option>
</select>&nbsp;
<span>生日:</span>
<input name="birth" type="text" value="" data-toggle="datepicker" placeholder="点击选择日期" data-pattern="yyyy-MM-dd" readonly="true">&nbsp;
<span>身份证:</span>
<input name="idcard" size="20"> <div class="btn-group">
<button type="submit" class="btn-green" data-icon="search">查询!</button>
<button type="reset" class="btn-orange" data-icon="times">重置</button>
</div>
</div>
</fieldset>
</form>
</div>
<div class="bjui-pageContent">
<table class="table table-bordered" id="datagrid-globals" data-toggle="datagrid" data-options="{
loadType:'GET',
filterThead:false,
columnFilter:false,
columnMenu:false,
showCheckboxcol:false,
height: '98%',
width:'100%',
gridTitle : '全局ID列表',
showToolbar: true,
toolbarCustom: globallistbar,
dataUrl: 'service/global/list',
dataType: 'json',
editMode: {dialog:{width:'500',height:300,title:'编辑人员信息',mask:true,fresh:true,beforeClose:'closeeditglobal'}},
editUrl: 'html/pixconf/editglobal.html',
delUrl:'service/global/delete',
delPK:'globalid',
paging: {pageSize:2,selectPageSize:'15,30'},
linenumberAll: true }">
<thead>
<tr>
<th data-options="{name:'globalid',align:'center',width:20,quicksort:false}">ID</th>
<th data-options="{name:'name',align:'center',width:70,quicksort:false}">姓名</th>
<th data-options="{name:'sex',render:'renderSexType',align:'center',width:40}">性别</th>
<th data-options="{name:'birth',align:'center',width:120,quicksort:false}">生日</th>
<th data-options="{name:'mobile',align:'center',width:140,quicksort:false}">手机号</th>
<th data-options="{name:'idcard',align:'center',width:170,quicksort:false}">身份证</th>
<th data-options="{name:'medcard',align:'center',width:170,quicksort:false}">社保号</th>
<th data-options="{render:'global_operation',align:'center',quicksort:false}">操作</th>
</tr>
</thead>
</table>
</div>
<script type="text/javascript">
function closeeditglobal() { $.CurrentNavtab.find('#datagrid-globals').datagrid('refresh');
return true;
} function renderSexType(value) {
return (value == 'F') ? '女' : '男';
} function newGlobal() {
BJUI.dialog({
id: 'newglobaldlg',
url: 'html/pixconf/addglobal.html',
title: '新增人员',
mask: true,
height: 400,
width: 500,
});
} function globallistbar() {
return '<button type="button" class="btn-blue" data-icon="plus" onclick="newGlobal()">新增</button>';
}
// 操作列
function global_operation() {
var html = '<button type="button" class="btn-green" data-toggle="edit.datagrid.tr">编辑</button>' + '<button type="button" class="btn-red" data-toggle="del.datagrid.tr">删除</button>' return html
}
</script>

效果如图:

分页

后台必须接收的参数为:pageCurrent,pageSize

后台返回的数据格式为:{"totalRow":1,"list":[{"globalid":3,"address":"","birth":"2017-01-08","idcard":"130828198711120030","medcard":"1122334455667788","mobile":"13399998888","name":"王五","sex":"F","pinyin":"wangwu"}],"status":0}

B-JUI 实践 之 带搜索与编辑的Datagrid的更多相关文章

  1. 带搜索的ComboBox

    带搜索的ComboBox就是给ComboBox一个依赖属性的ItemSource,然后通过数据源中是否包含要查询的值,重新给ComboBox绑定数据源. public class EditComboB ...

  2. Easy UI combobox实现类似 Select2的效果,下拉带搜索框

    一直在开发一个新系统,其中用Easy UI作为前端框架,少不了用 combobox做为一个 下拉控件,它支持 可编辑 模糊本地数据过滤,也可支持 不可编辑 下拉 选择的功能: $('#ID' ).co ...

  3. YII关联字段并带搜索排序功能

    1.简介 从接触yii框架到现在已经快有两个月了,但是自己对yii框架的了解程度并不是很深,并没有系统地去学习,仅仅只是在做项目的时候遇到不懂得知识才去翻手册. 在上一个项目中因为需要将关联的表的字段 ...

  4. Android UI(五)云通讯录项目之联系人列表,带侧滑选择,带搜索框

    作者:泥沙砖瓦浆木匠网站:http://blog.csdn.net/jeffli1993个人签名:打算起手不凡写出鸿篇巨作的人,往往坚持不了完成第一章节.交流QQ群:[编程之美 365234583]h ...

  5. 带搜索框的jQuery下拉框插件

    由于下拉框的条数有几十个,于是打算找一个可以搜索查找功能的下拉框,刚开始在网上看了几个,都是有浏览器兼容性问题,后来看到这个“带搜索框的jQuery下拉框美化插件 searchable”,看演示代码简 ...

  6. jqgrid 使用自带的行编辑

    上篇jqgrid 单击行启用行编辑,切换行保存原编辑行 本篇,说说使用jqgrid自带的行编辑 1)设置需要编辑的列  editable: true colModel: [ { label: '字段编 ...

  7. 多选下拉框带搜索(aps.net)

    自己写了一个带搜索功能的多选下拉框,为了要获取值,就没有封装插件,实现思路 1.一个文本框 做搜索 2.一个文本框显示选中文本,一个隐藏控件存值 3.一个div里面绑定CheckBoxList控件(这 ...

  8. 【Select2】带搜索框的下拉框美化插件

    1  引入js css 文件 <script src="js/jquery-1.11.1.min.js"></script> <script src= ...

  9. select2 下拉搜索 可编辑可搜索 / 只可搜索

    官网 (http://select2.github.io/examples.html) <!--引入select2需要的文件--> <script type="text/j ...

随机推荐

  1. wind10系统 Atheros AR9271 Wireless Network Adapter USBwifi无线网卡的驱动安装解决无法搜索wifi信号,连接wifi信号无法上网的问题

    一.解决无法搜索wifi信号的问题 卸载掉之前的驱动,上网下载其他的驱动程序安装. http://drivers.mydrivers.com/drivers/463_185289.htm 二.安装完后 ...

  2. Activity进程和线程之间的关系

    1,四大组件并不是程序(进程)的全部,只是他的零件. 2,应用程序启动后,将创建ActivityThread主线程. 3,同一包中的组件将运行在想通的进程空间里面. 4,不同包中的组件可以通过一定的方 ...

  3. android开发中应该注意的问题

    1. Activity可继承自BaseActivity,便于统一风格与处理公共事件,构建对话框统一构建器的建立,万一需要整体变动,一处修改到处有效.   2. 数据库表段字段常量和SQL逻辑分离,更清 ...

  4. IDEA github的应用

    1.下载并安装一个git 一直点下一步就可以 2.去github官网注册一个账号 https://github.com/ 2.1点击Sign up 进入注册页面 2.2填写注册信息,点击Create ...

  5. Delphi中register, pascal, cdecl, stdcall, safecall(转)

    源:http://blog.sina.com.cn/s/blog_552c78120100hsr9.html 注: 使用错误,或者在该加的地方没有加,可能会出现"privileged ins ...

  6. ural1494 Monobilliards

    Monobilliards Time limit: 1.0 secondMemory limit: 64 MB A monobilliards table set up in a gaming hou ...

  7. angularJs-UI-bootstrap系列教程2(According)

    废话不说上代码 angular.module('MyApp', ['ngAnimate', 'ngTouch', 'ui.bootstrap']) .controller('accordionCtrl ...

  8. CodeForces 617D Polyline

    无脑暴力判断. #include<cstdio> #include<cstring> #include<vector> #include<cmath> ...

  9. jpg转bmp(使用libjpeg)

    源: jpg转bmp(使用libjpeg) [转]JPEG压缩原理 bmp转jpg(使用libjpeg)

  10. js-权威指南学习笔记9

    第九章 类和模块 1.在JS中,类的实现是基于其原型继承机制的,如果两个实例都从同一个原型对象上继承了属性,我们说它们是同一个实例. 2.常见的编程约定:定义构造函数既是定义类,并且类名首字母要大写. ...