Jquery dataTable可编辑单元格

编程入门 行业动态 更新时间:2024-10-28 08:30:06
本文介绍了Jquery dataTable可编辑单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我放弃了,因为我在过去4个小时里一直在搞乱,我只是没有到任何地方。当使用这里发现的jquery datatable时。 datatables/examples/api/editable.html (似乎是非常流行的插件)除了可编辑的单元格部分,我可以得到很多我想要工作的所有内容。我有这个顺序的文件

I give up as I have been messing around with this for the past 4 hours and I am just not getting anywhere. When using the jquery datatable found here. datatables/examples/api/editable.html (seems like a very popular plug in) I can get pretty much everything I want to work except the editable cell part. I have my file in this order

<script src="JS/jquery.js"></script> <script src="JS/jquery.dataTables.min.js" type="text/javascript"></script> <script src="JS/jquery.jeditable.js"></script> <script src="JS/jquery.validate.js"></script> <script src="JS/ColReorder.min.js"></script> <link href="JS/css/jquery.dataTables.css" rel="stylesheet" />

然后我有这个脚本来初始化表。

and then I have this script to get the table initialized.

function formattable(thistable) { //alert(thistable + " from format table") // $(document).ready(function () { // ADPControlProcessor_Table1 //$("#ADPControlProcessor_GridView1").dataTable(); var oTable = $("#ADPControlProcessor_GridView1").dataTable({ //"bFilter": true, "sScrollY": "200px", "bPaginate": false, "bAutoWidth": false, "sDom": 'Rlfrtip' //}); //alert("running"); }); //var oTable = $('#example').dataTable(); /* Apply the jEditable handlers to the table */ $('td', oTable.fnGetNodes()).editable('../examples_support/editable_ajax.php', { "callback": function (sValue, y) { var aPos = oTable.fnGetPosition(this); oTable.fnUpdate(sValue, aPos[0], aPos[1]); }, "submitdata": function (value, settings) { return { "row_id": this.parentNode.getAttribute('id'), "column": oTable.fnGetPosition(this)[2] }; }, "height": "14px" });

我不知道要尝试什么。任何人都可以指向正确的方向。

I dont know what elese to try. can anyone point me in the right direction.

推荐答案

你没有初始化正确尝试这个

you are not initialize correct Try this one

$(document).ready(function() { /* Init DataTables */ var oTable = $('#example').dataTable(); /* Apply the jEditable handlers to the table */ $('td', oTable.fnGetNodes()).editable( '../examples_support/editable_ajax.php', { "callback": function( sValue, y ) { var aPos = oTable.fnGetPosition( this ); oTable.fnUpdate( sValue, aPos[0], aPos[1] ); }, "submitdata": function ( value, settings ) { return { "row_id": this.parentNode.getAttribute('id'), "column": oTable.fnGetPosition( this )[2] }; }, "height": "14px" } ); } );

这里是现场示例点击这里

更多推荐

Jquery dataTable可编辑单元格

本文发布于:2023-11-23 02:25:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619743.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元格   编辑   Jquery   dataTable

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!