DataTables自行封装请求参数和返回数据的零耦合服务端分页示例

上传者: hzqiji | 上传时间: 2019-12-21 18:50:21 | 文件大小: 3.86MB | 文件类型: rar
使用DataTable默认的ajax交互功能,对传给后台和从后台获取的数据都有命名格式要求,这样一来耦合度较高,不利于后期扩展,不能直接适用于需要跟多种不同前端或其他业务交互的项目。本例子主要展示了自行封装请求参数和返回数据的用法,对后台的交互没有任何格式和命名限制。 基于Bootstrap 2.3.2,相关的其他插件包括图标控件FontAwesome、等待提示控件Spinjs(修改版)、弹窗控件lhgdialog(修改版) 主要展现: 封装请求参数(查询、排序、分页,不再需要data和dataSrc) 封装返回数据 自定义查询参数 服务器分页 自行控制和自定义遮罩效果 生成自定义效果的单元格(在线离线) 生成复选框单元格 响应复选框选择事件 生成操作按钮单元格 响应操作栏按钮点击事件 响应行点击事件 渲染回调事件(默认选中第一行) 分页栏增加跳页功能(直接修改了dataTables.bootstrap.js和dataTables.bootstrap.css)

文件下载

资源详情

[{"title":"( 87 个子文件 3.86MB ) DataTables自行封装请求参数和返回数据的零耦合服务端分页示例","children":[{"title":"DataTablesCustom","children":[{"title":".settings","children":[{"title":"org.eclipse.wst.jsdt.ui.superType.name <span style='color:#111;'> 6B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.project.facet.core.xml <span style='color:#111;'> 414B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.common.component <span style='color:#111;'> 507B </span>","children":null,"spread":false},{"title":"org.eclipse.wst.jsdt.ui.superType.container <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":".jsdtscope <span style='color:#111;'> 522B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 364B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"com","children":[{"title":"thxopen","children":[{"title":"dt","children":[{"title":"bean","children":[{"title":"User.java <span style='color:#111;'> 1.84KB </span>","children":null,"spread":false}],"spread":true},{"title":"sys","children":[{"title":"Config.java <span style='color:#111;'> 1023B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"WebRoot","children":[{"title":"dt.sqlite3 <span style='color:#111;'> 37.00KB </span>","children":null,"spread":false},{"title":"list.jsp <span style='color:#111;'> 4.57KB </span>","children":null,"spread":false},{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 39B </span>","children":null,"spread":false}],"spread":true},{"title":"WEB-INF","children":[{"title":"classes","children":[{"title":"com","children":[{"title":"thxopen","children":[{"title":"dt","children":[{"title":"bean","children":[{"title":"User.class <span style='color:#111;'> 2.18KB </span>","children":null,"spread":false}],"spread":true},{"title":"sys","children":[{"title":"Config.class <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"lib","children":[{"title":"sqlite-jdbc-3.7.6.3-20110609.081603-3.jar <span style='color:#111;'> 3.02MB </span>","children":null,"spread":false},{"title":"gson-2.3.1.jar <span style='color:#111;'> 205.91KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"asset","children":[{"title":"css","children":[{"title":"user-manage.css <span style='color:#111;'> 2.64KB </span>","children":null,"spread":false}],"spread":true},{"title":"js","children":[{"title":"user-manage.js <span style='color:#111;'> 8.95KB </span>","children":null,"spread":false},{"title":"constant.js <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false}],"spread":true},{"title":"lib","children":[{"title":"font-awesome-4.2.0","children":[{"title":"css","children":[{"title":"font-awesome-ie7.min.css <span style='color:#111;'> 46.36KB </span>","children":null,"spread":false},{"title":"font-awesome.min.css <span style='color:#111;'> 21.47KB </span>","children":null,"spread":false},{"title":"font-awesome.css <span style='color:#111;'> 26.03KB </span>","children":null,"spread":false}],"spread":false},{"title":"fonts","children":[{"title":"fontawesome-webfont.eot <span style='color:#111;'> 54.69KB </span>","children":null,"spread":false},{"title":"fontawesome-webfont.woff <span style='color:#111;'> 63.92KB </span>","children":null,"spread":false},{"title":"FontAwesome.otf <span style='color:#111;'> 83.89KB </span>","children":null,"spread":false},{"title":"fontawesome-webfont.svg <span style='color:#111;'> 280.28KB </span>","children":null,"spread":false},{"title":"fontawesome-webfont.ttf <span style='color:#111;'> 109.53KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"jquery-1.11.3.min.js <span style='color:#111;'> 93.71KB </span>","children":null,"spread":false},{"title":"lhgdialog-4.2.0","children":[{"title":"lhgdialog.js <span style='color:#111;'> 44.28KB </span>","children":null,"spread":false},{"title":"lhgdialog.min.js <span style='color:#111;'> 14.29KB </span>","children":null,"spread":false},{"title":"skins","children":[{"title":"bootstrap2.css <span style='color:#111;'> 8.29KB </span>","children":null,"spread":false},{"title":"icons","children":[{"title":"success.gif <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false},{"title":"error.gif <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"prompt.gif <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"face-smile.png <span style='color:#111;'> 6.72KB </span>","children":null,"spread":false},{"title":"32X32","children":[{"title":"i.png <span style='color:#111;'> 4.01KB </span>","children":null,"spread":false},{"title":"fail.png <span style='color:#111;'> 4.22KB </span>","children":null,"spread":false},{"title":"hits.png <span style='color:#111;'> 4.04KB </span>","children":null,"spread":false},{"title":"succ.png <span style='color:#111;'> 4.28KB </span>","children":null,"spread":false}],"spread":false},{"title":"face-sad.png <span style='color:#111;'> 6.63KB </span>","children":null,"spread":false},{"title":"lhgcore.gif <span style='color:#111;'> 339B </span>","children":null,"spread":false},{"title":"confirm.gif <span style='color:#111;'> 1.86KB </span>","children":null,"spread":false},{"title":"gb_tip_layer_ie6.png <span style='color:#111;'> 2.22KB </span>","children":null,"spread":false},{"title":"gb_tip_layer.png <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"tips.gif <span style='color:#111;'> 905B </span>","children":null,"spread":false},{"title":"discuz_bg.gif <span style='color:#111;'> 6.62KB </span>","children":null,"spread":false},{"title":"alert.gif <span style='color:#111;'> 1.42KB </span>","children":null,"spread":false},{"title":"loading.gif <span style='color:#111;'> 6.51KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"dataTables-1.10.7","children":[{"title":"media","children":[{"title":"css","children":[{"title":"jquery.dataTables.min.css <span style='color:#111;'> 13.11KB </span>","children":null,"spread":false},{"title":"jquery.dataTables.css <span style='color:#111;'> 15.02KB </span>","children":null,"spread":false},{"title":"jquery.dataTables_themeroller.css <span style='color:#111;'> 13.90KB </span>","children":null,"spread":false}],"spread":false},{"title":"images","children":[{"title":"sort_asc.png <span style='color:#111;'> 160B </span>","children":null,"spread":false},{"title":"sort_desc.png <span style='color:#111;'> 158B </span>","children":null,"spread":false},{"title":"sort_both.png <span style='color:#111;'> 201B </span>","children":null,"spread":false},{"title":"Sorting icons.psd <span style='color:#111;'> 26.85KB </span>","children":null,"spread":false},{"title":"sort_desc_disabled.png <span style='color:#111;'> 146B </span>","children":null,"spread":false},{"title":"sort_asc_disabled.png <span style='color:#111;'> 148B </span>","children":null,"spread":false},{"title":"favicon.ico <span style='color:#111;'> 894B </span>","children":null,"spread":false}],"spread":false},{"title":"js","children":[{"title":"jquery.dataTables.min.js <span style='color:#111;'> 78.01KB </span>","children":null,"spread":false},{"title":"jquery.dataTables.js <span style='color:#111;'> 428.69KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"plugins","children":[{"title":"i18n","children":[{"title":"Chinese.lang <span style='color:#111;'> 737B </span>","children":null,"spread":false}],"spread":false},{"title":"integration","children":[{"title":"bootstrap","children":[{"title":"images","children":[{"title":"sort_asc.png <span style='color:#111;'> 160B </span>","children":null,"spread":false},{"title":"sort_desc.png <span style='color:#111;'> 158B </span>","children":null,"spread":false},{"title":"sort_both.png <span style='color:#111;'> 201B </span>","children":null,"spread":false},{"title":"sort_desc_disabled.png <span style='color:#111;'> 146B </span>","children":null,"spread":false},{"title":"sort_asc_disabled.png <span style='color:#111;'> 148B </span>","children":null,"spread":false}],"spread":false},{"title":"2","children":[{"title":"index.html <span style='color:#111;'> 10.08KB </span>","children":null,"spread":false},{"title":"dataTables.bootstrap.js <span style='color:#111;'> 4.60KB </span>","children":null,"spread":false},{"title":"dataTables.bootstrap.css <span style='color:#111;'> 5.00KB </span>","children":null,"spread":false},{"title":"dataTables.bootstrap.min.js <span style='color:#111;'> 1.66KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"font-awesome","children":[{"title":"dataTables.fontAwesome.css <span style='color:#111;'> 3.29KB </span>","children":null,"spread":false},{"title":"foundation.html <span style='color:#111;'> 11.37KB </span>","children":null,"spread":false},{"title":"bootstrap.html <span style='color:#111;'> 11.43KB </span>","children":null,"spread":false},{"title":"datatables.html <span style='color:#111;'> 11.30KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"bootstrap-2.3.2","children":[{"title":"css","children":[{"title":"bootstrap-responsive.min.css <span style='color:#111;'> 16.45KB </span>","children":null,"spread":false},{"title":"bootstrap.min.css <span style='color:#111;'> 103.52KB </span>","children":null,"spread":false},{"title":"bootstrap.css <span style='color:#111;'> 124.36KB </span>","children":null,"spread":false},{"title":"bootstrap-responsive.css <span style='color:#111;'> 21.58KB </span>","children":null,"spread":false}],"spread":false},{"title":"img","children":[{"title":"glyphicons-halflings.png <span style='color:#111;'> 12.50KB </span>","children":null,"spread":false},{"title":"glyphicons-halflings-white.png <span style='color:#111;'> 8.57KB </span>","children":null,"spread":false}],"spread":false},{"title":"js","children":[{"title":"bootstrap.min.js <span style='color:#111;'> 27.96KB </span>","children":null,"spread":false},{"title":"bootstrap.js <span style='color:#111;'> 60.43KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"spin-2.1.0","children":[{"title":"jquery.spin.merge.js <span style='color:#111;'> 6.53KB </span>","children":null,"spread":false}],"spread":false},{"title":"json2.js <span style='color:#111;'> 17.59KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"index.jsp <span style='color:#111;'> 12.32KB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 652B </span>","children":null,"spread":false},{"title":"readme.txt <span style='color:#111;'> 757B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • displaydale :
    没有一点用。。。
    2020-10-06
  • 长安三日 :
    很有参考价值,已使用
    2020-03-21
  • season8862008 :
    很有参考价值,已使用
    2018-08-27
  • Veeney :
    很有帮助,很实用!
    2018-06-06
  • zhuanshujianghai :
    具有参考价值
    2018-05-30

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明