how to use datatables editor
Basic initialisation
Editor is a Create, Read, Update and Delete (CRUD) extension forDataTables that provides the ability to easily add, edit and delete rows on a database that is displayed by a DataTable. Editor provides a clean and responsive interface for end user manipulation of data, an expressive API for complete control and a well defined server communications protocol for data submission.
This simple example shows a table with seven fields, each of which can be edited as plain text. In other examples we will explore how to add date pickers, select elements and other controls to make form input intuitive for the system user, among many other aspects of the Editor API.
- https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css
- https://cdn.datatables.net/buttons/1.1.2/css/buttons.dataTables.min.css
- https://cdn.datatables.net/select/1.1.2/css/select.dataTables.min.css
- ../../extensions/Editor/css/editor.dataTables.min.css
<table id="example" class="display" cellspacing="0" width="100%">
<thead> <tr> <th>Name</th> <th>Position</th> <th>Office</th> <th>Extn.</th> <th>Start date</th> <th>Salary</th> </tr> </thead> <tfoot> <tr> <th>Name</th> <th>Position</th> <th>Office</th> <th>Extn.</th> <th>Start date</th> <th>Salary</th> </tr> </tfoot> </table>var editor; // use a global for the submit and return data rendering in the examples
$(document).ready(function() { editor = new $.fn.dataTable.Editor( { ajax: "../php/staff.php", table: "#example", fields: [ { label: "First name:", name: "first_name" }, { label: "Last name:", name: "last_name" }, { label: "Position:", name: "position" }, { label: "Office:", name: "office" }, { label: "Extension:", name: "extn" }, { label: "Start date:", name: "start_date", type: "datetime" }, { label: "Salary:", name: "salary" } ] } ); $('#example').DataTable( { dom: "Bfrtip", ajax: "../php/staff.php", columns: [ { data: null, render: function ( data, type, row ) { // Combine the first and last names into a single table field return data.first_name+' '+data.last_name; } }, { data: "position" }, { data: "office" }, { data: "extn" }, { data: "start_date" }, { data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) } ], select: true, buttons: [ { extend: "create", editor: editor }, { extend: "edit", editor: editor }, { extend: "remove", editor: editor } ] } );} );how to use datatables editor的更多相关文章
- datatables editor fields type
其实editor fields type 默认支持的输入类型就是w3c输入框类型. text number password textarea select checkbox ...
- js page click
DataTables Editor Your account: Login / Register Examples Manual Reference Options API Events Butt ...
- datatables中的Options总结(3)
datatables中的Options总结(3) 十.ColReorder colReorder.fixedColumnsLeft 不允许x列重新排序(从左数) colReorder.fixedCol ...
- datatables中的Options总结(2)
datatables中的Options总结(2) 五.datatable,列 columnDefs.targets 分配一个或多个列的列定义. columnDefs 设置列定义初始化属性. colum ...
- Datatables JQuery插件
Datatables是一款jquery表格插件.它是一个高度灵活的工具,可以将任何HTML表格添加高级的交互功能. 分页,即时搜索和排序 几乎支持任何数据源:DOM, javascript, Ajax ...
- Datatables 在asp.net mvc中的使用
前言 最近使用ABP(ASP.NET Boilerplate)做新项目,以前都是自己扩展一个HtmlHelper来完成同步/异步分页,但是有个地方一直不满意,排序太费劲. 以前接触过一点点的Datat ...
- JQuery DataTables Editor---页面内容修改&&数据库信息修改 (2)
接上篇博文,详细说一下js代码以及JQuery DataTables Editor---页面内容修改&&数据库信息修改遇到的问题和解决办法. 1.关于dialog 初始化: $(&qu ...
- JQuery DataTables Editor---只修改页面内容
近来在工作中需要对JQuery DataTables进行增,删,改的操作,在网上找了一些资料,感觉比较的好的就是(http://editor.datatables.net/)文章中所展示的操作方法(如 ...
- JQuery DataTables Editor---页面内容修改&&数据库信息修改 (1)
我们使用jquery datatables 不光是为了对数据的展示,同时需要对数据惊行简单的操作,这个操作分为两个部分:1.页面内容的修改:2.对应的数据库信息的修改. 前一篇博文介绍了页面级的操作, ...
随机推荐
- mysql多字段组合删除重复行
DELETEFROM boll_paramWHERE id in ( SELECT a.id FROM ( SELECT id FROM boll_param WHERE (symbol, time_ ...
- 剑指Offer(书):数组中重复的数字
题目:找出数组中重复的数字. 说明:在一个长度为n的数组里的所有数字都在0~n-1的范围内,数组中某些数字是重复的,但是不知道有几个数字重复了,也不知道每个数字重复了几次.请找出数组中任意一个重复的数 ...
- solr 时区问题
本人使用solr版本5.0.0,使用jetty启动 solr默认UTC时区,与我们相差八小时,按照网络上资料修改 C:\Users\hp\Desktop\solr-5.0.0\bin 下的solr.i ...
- 【CodeForces 426】div1 B The Bakery
Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredient ...
- Tomcat 7.0.3x 启动慢并且遇到StackOverflowError的异常的解决办法
http://qiuboboy.iteye.com/blog/1853216 使用tomcat 7.0.3x版本的同学可以发现tomcat启动慢了不少,而且还可能遇到如下启动时异常: Unable t ...
- loadrunner报错-持续更新
一.关联使用web_reg_save_param报错 1.以下是网页中需要关联的地方,有2处,通过网页查看源代码可以看: 2.还可以通过Generation Log来查看需要关联的地方: 3. 然后再 ...
- 一篇文章告诉你,TLS 1.3 如何用性能为 HTTPS 正名
序•魔戒再现 几天前,OpenSSL 官方宣布即将发布的新版本 (OpenSSL 1.1.1) 将会提供 TLS 1.3 的支持,而且还会和之前的 1.1.0 版本完全兼容,这当然是个好消息. ...
- [luoguP1273] 有线电视网(DP)
传送门 f[i][j]表示节点i选j个用户的最大收益 #include <cstdio> #include <cstring> #include <iostream> ...
- bzoj3572[Hnoi2014] 世界树 虚树+dp+倍增
[Hnoi2014]世界树 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 1921 Solved: 1019[Submit][Status][Dis ...
- struts2 标签库使用
[引用]json 使用 [引用]struts2 标签库使用 2011-05-11 16:13:00| 分类: 默认分类 | 标签: |举报 |字号大中小 订阅 本文转载自kangzye<st ...