使用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. Permission denied: user=xxj, access=WRITE, inode="user":hadoop:supergroup:rwxr-xr-x

    在windows中运行eclipse时报错Permission denied: user=xxj, access=WRITE, inode="user":hadoop:superg ...

  2. 转:Validation of viewstate MAC failed异常的原因及解决方法

    ViewState是一种机制,ASP.NET 使用这种机制来跟踪服务器控件状态值,否则这些值将不作为 HTTP 窗体的一部分而回传.也就是说在页面刷新或者回传的时候控件的值将被清空,我们在aspx.c ...

  3. 利用fiddler给android模拟器抓包

    启动模拟器 setting---wireless&networks----mobile networks----access pointnames -------------------- 然 ...

  4. JAVA中SSL证书认证通讯

    JAVA中SSL证书认证通讯 SSL通讯服务端 /******************************************************************** * 项目名称 ...

  5. Quick Cocos2dx 场景对象基类实现

    从使用Quick-Cocos2d-x搭建一个横版过关游戏(四)拷来个进度条类, 但是由于那个类有个bug,在setProgress里面self.fill是找不到的,所以我改进了一下,代码如下: loc ...

  6. openstack controller ha测试环境搭建记录(十四)——配置cinder(存储节点)

    先简述cinder存储节点的配置:  1.IP地址是10.0.0.41:  2.主机名被设置为block1:  3.所有节点的hosts文件已添加相应条目:  4.已经配置了ntp时间同步:  5.已 ...

  7. gtk

    GTK官网:www.gtk.org sudo apt-get install build-essential 安装GTK开发套件: sudo apt-get install libgtk2.0-dev ...

  8. precision、recall、accuracy的概念

    机器学习中涉及到几个关于错误的概念: precision:(精确度) precision = TP/(TP+FP) recall:(召回率) recall = TP/(TP+FN) accuracy: ...

  9. ZOJ 3923 Handshakes

    水题. 算一下每个人和之前的人握手次数+之后的人和这个人握手次数.取最大值. #include<cstdio> #include<cstring> #include<cm ...

  10. 硬件和软件兼容i2c协议的24Cxx系列EEPROM存储器(转)

    源:硬件和软件兼容i2c协议的24Cxx系列EEPROM存储器 硬件上由于24c01的A0A1A2管脚不允许悬空,故暂时的想法是兼容24c02 ---24c16 使用一个dip8封装的芯片插座,A0 ...