【问题标题】:Jquery datatable not getting editableJquery数据表无法编辑
【发布时间】:2013-07-15 07:24:57
【问题描述】:

我的 jquery 数据表无法编辑..我使用的是简单的 html 页面

  jQuery(document).ready(function () {
        jQuery('#detailsgrid').dataTable()
      .makeEditable();
    });

像这样添加行

 function addrow() {
        //alert("sxcsdsd");
        //jQuery('#detailsgrid').dataTable().makeEditable();
        jQuery('#detailsgrid').dataTable().fnAddData([
                          '<input id=\"Checkbox\" type =\"checkbox\" name = chk  onclick = javascript:removeRow(this)  />',
                           jQuery("#txtcasetype").val(),
                           jQuery("#txtcd").val(),
                           jQuery("#txtpatclass").val(),
                           jQuery("#txtcd1").val(),
                           jQuery("#txtresamt").val(),
                           jQuery("#txtadmamt").val()]);
    }

我做错了..我还注册了所需的插件

 <script src="jquery.dataTables.js" type="text/javascript"></script>
<script src="jquery.dataTables.editable.js" type="text/javascript"></script>

【问题讨论】:

    标签: jquery datatables


    【解决方案1】:

    试试这个 Google 代码文件。

    演示

    http://jquery-datatables-column-filter.googlecode.com/svn/trunk/default.html

    下载

    https://code.google.com/p/jquery-datatables-column-filter/

    它肯定会帮助你。


    或者你可以使用这个

    您可以使用 fnDraw 函数重绘表格。试试这个:

    var $dataTable = $("#my-datatable").dataTable({ /* setup */ });
    
    $("#refreshButton").click(function() {
        $dataTable.fnDraw();
    });
    

    阅读文档中的 fnDraw 条目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多