【问题标题】:datatable editable column width behaving strange for empty column数据表可编辑列宽对于空列表现奇怪
【发布时间】:2015-02-05 07:30:44
【问题描述】:

我正在使用数据表可编辑插件。一切都很好,但是当我尝试编辑第一行的任何空列时,列宽的行为很奇怪。对于其他行,一切正常。

       

这里是代码 sn-p :

$(document).ready(function () {
    $("#dbResultsTable").dataTable({
                "bServerSide": true,
                "sAjaxSource": "/DataTableTest/TableEditAjaxRequest",
                "bProcessing": true,
                "sPaginationType": "full_numbers",
                "bJQueryUI": false,
                "scrollX" : true,
                 "aoColumns": [
                              {  "sName": "MyID",
                              },
                               {
                                 "sName": "Operation",
                                }
                               ]
          ]
         }).makeEditable({ 
              "height": "100%",
            "width": "100%",   
                } 

         );

    });

一旦我编辑了第一行的任何一列,一切都会恢复正常。请帮帮我。

【问题讨论】:

  • 任何人对此有任何线索吗??

标签: datatable jquery-datatables jeditable jquery-datatables-editor


【解决方案1】:

最后我解决了,我只需要在桌子上调用 fnAdjustColumnSizing()。

 $(document).ready(function () {
   var oTable = $("#dbResultsTable").dataTable({
                "bServerSide": true,
                "sAjaxSource": "/DataTableTest/TableEditAjaxRequest",
                "bProcessing": true,
                "sPaginationType": "full_numbers",
                "bJQueryUI": false,
                "scrollX" : true,
                 "aoColumns": [
                              {  "sName": "MyID",
                              },
                               {
                                 "sName": "Operation",
                                }
                               ]
          ]
         }).makeEditable({ 
              "height": "100%",
            "width": "100%",   
                } 

         );
if ( oTable.length > 0 ) {
        oTable.fnAdjustColumnSizing();
    }

    });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-27
    • 1970-01-01
    相关资源
    最近更新 更多