我有一个大表,它正在使用tablesorter作为导出功能。我目前在表排序器的构造中设置了标头过滤器,如下所示:
headers: {
5: {sorter: "select"},
7: {sorter: "select"},
0: {sorter: "checkbox"},
1: {sorter: "inputs"},
2: {sorter: "inputs"},
3: {sorter: "inputs"},
4: {sorter: "inputs"},
6: {sorter: "inputs"},
8: {sorter: "inputs"},
9: {sorter: "inputs"},
10: {sorter: "inputs"},
11: {sorter: "inputs"},
12: {sorter: "inputs"},
13: {sorter: "inputs"}
}
我也将output_delivery设置为下载。我遇到的问题是第5列和第7列。它正在将奇数数据导出到单元中。它会在事实之后提取选择框的所有值和所选选项的值。
即:----1234567891011121314151617181920 4
不仅仅是4
。
要仅导出4个而不是所有选择选项,我还需要做其他事情吗?
这是我的表排序器构造:
$('#' + table_list[i] + '_table').tablesorter({
widgets: ['zebra', 'stickyHeaders', 'filter', 'output'],
widgetOptions: {
output_delivery: 'd',
output_saveFileName: table_list[i] + '-' + (current_date.getMonth() + 1) + '-' + current_date.getDate() + '-' + current_date.getFullYear() + '.csv',
output_ignoreColumns: [0]
},
headers: {
5: {sorter: "select"},
7: {sorter: "select"},
0: {sorter: "checkbox"},
1: {sorter: "inputs"},
2: {sorter: "inputs"},
3: {sorter: "inputs"},
4: {sorter: "inputs"},
6: {sorter: "inputs"},
8: {sorter: "inputs"},
9: {sorter: "inputs"},
10: {sorter: "inputs"},
11: {sorter: "inputs"},
12: {sorter: "inputs"},
13: {sorter: "inputs"}
}
});
感谢所有帮助。