JQuery 1.10.2 Datatable makeEditable() is Not a function

匿名 (未验证) 提交于 2019-12-03 00:57:01

问题:

My question is same as addressed here

But It was working, if we use 1.jquery1.7.2.js

2.jquery.dataTables.min.js(1.7.2)

3.jquery.jeditable.js(1.7.3)

4.jquery.dataTables.editable.js(2.3.3)

But currently I am using 1.jquery1.10.2.js

2.jquery.dataTables.min.js(1.10.2)

3.jquery.jeditable.js(1.7.3)

4.jquery.dataTables.editable.js(2.3.3) It throwing error table.makeEditable() is not a function. I did not found where is the Mistake is? Please Help Me. Thanks In Advance.

<html>   <head>     <link href="/JqueryDatatable/css/dataTables.jqueryui.css" type="text/css" rel="stylesheet"/>     <link href="/JqueryDatatable/css/jquery-ui.css" type="text/css" rel="stylesheet"/>     <link href="/JqueryDatatable/css/jquery.dataTables.css" type="text/css" rel="stylesheet"/>      <script type="text/javascript" src="/JqueryDatatable/js/jquery-1.10.2.js" ></script>        <script type="text/javascript" src="/JqueryDatatable/js/jquery.dataTables.js" ></script>     <script type="text/javascript" src="/JqueryDatatable/js/jquery.jeditable.js" ></script>     <script type="text/javascript" src="/JqueryDatatable/js/jquery.dataTables.editable.js" ></script> 

<script type="text/javascript">  $(document).ready(function() {   var table= $('#example').DataTable( {       //  "sScrollY":        250      } );     // Apply the filter    table.columns().eq( 0 ).each( function ( colIdx ) {         $( 'input', table.column( colIdx ).header() ).on( 'keyup change', function () {             table                 .column( colIdx )                 .search( this.value )                 .draw();         } );     } );      //Making datatable as editable columns     table.makeEditable();  } ); 

回答1:

Change this

  var table= $('#example').DataTable( { 

to

  var table= $('#example').dataTable( { 

Im facing same problem, and this solution worked perfectly.



回答2:

Try this

<script type="text/javascript">    $(document).ready(function() {     var table= $('#example').DataTable( {   //  "sScrollY":        250     } );  // Apply the filter    table.columns().eq( 0 ).each( function ( colIdx ) {     $( 'input', table.column( colIdx ).header() ).on( 'keyup change', function () {         table             .column( colIdx )             .search( this.value )             .draw()             .makeEditable();     } );    } );    } ); 


回答3:

this is not answer but would like if you have found an answer to your question as I am facing similar challenge and the reason is because you have used the capital "D" for datatable if you had used the small "d" as in

var table= $('#example').dataTable( { // "sScrollY": 250

} );

makeEditable will work for that. But in my case, I need to use the capital "D" because I need to use the row().child() function of the datatable.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!