当标题游标发生更改时,Jquery Datatable调整大小问题

时间:2016-04-15 06:18:26

标签: jquery css datatable

我正在为我的应用程序使用jquery datatable 1.10。我的数据表定义如下:

$("#info_table", node).DataTable(
                        {
                            "dom" : 'Rflrtip',
                            "rtl" : true,
                            "paging" : true,
                            "pagingType": "full_numbers",
                            "ordering" : true,
                            "searching" : true,
                            "columns" : aoColumns,
                            "fnCreatedRow" : function(nRow, aData,
                                    iDataIndex) {
                                $(nRow).attr('id', aData.ID); 
                            },
                            "language": {
                                  "emptyTable": "No records to display"
                            }
                        });

问题是我需要更改表格光标以进行排序。以下CSS允许我更改光标。

#info_table th.sorting, #info_table th.sorting_asc, #info_table th.sorting_desc{
cursor: pointer !important;
} 

但是当我更换光标时,它不允许我重新调整列的大小。我的应用程序中需要提供列调整大小选项。在进行cusor更改时,任何人都可以帮我找到重新调整列大小的方法。

1 个答案:

答案 0 :(得分:0)

是的,你需要为数据表使用resize column插件。

str = "Lorem ipsum dolor sit amet"

str = str.replace(/\w+/g, function(word) {
  
  if (word === "dolor")
    return word;
  
  return 'A' + 'b'.repeat(word.length - 2) + 'c';

});

document.write(str);
相关问题