【问题标题】:HTML Table Filter Script + sortable table: Always show tfoot and theadHTML 表格过滤器脚本 + 可排序表格:始终显示 tfoot 和 thead
【发布时间】:2012-07-16 02:01:16
【问题描述】:

我使用this 精彩的脚本使我的表格可排序并为其添加一些过滤器。我的问题是我需要始终查看标题中的第二行(带有复选框)。我避免在单击时对行进行排序(通过将其设为 td 而不是 th 尽管它在 thead 中)。

所以主要问题是我需要查看复选框(thead/td,当单击以将表格排序为上面的行时它不应该处于活动状态)并且还总是看到 tfoot - 当它也被隐藏时添加过滤器...

这是我的设置

var Props =  {
          popup_filters: true,
          mark_active_columns: true,
          sort: true,
          sort_config: {  
            sort_types:['EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU']  
          },  
          loader: true,  
          loader_html: '<img src="/images/load.gif" style="vertical-align:middle; margin:0 5px 0 5px"><span>Зареждане...</span>',
          mark_active_columns: true,
          col_0: "select",  
            col_1: "multiple",  
            col_2: "select",  
            col_3: "select",
            cEUtom_slc_options: {  
        cols:[1],  
        texts: [['0- 50','60 - 80','80 - 100']],  
        values: [  
                    ['<=50','>60 && <=80','>80 && <=100']  
                ],  
        sorts: [false],
        sort_config: {  
            sort_types:['EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU','EU']  
        }, 
    },   
    themes: {   
    name:['MyTheme'],   
    src:['TableFilter/TF_Themes/MyTheme/MyTheme.css'],   
    description:['My stylesheet'],   
    initialize:[null]  
} 
        };
          setFilterGrid("advancedtable1",Props );

【问题讨论】:

    标签: javascript html html-table


    【解决方案1】:

    我找到了我需要的东西 首先我们需要做的是获取页脚的行号: var totRowIndex = tf_Tag(tf_Id('advancedtable1'),"tr").length; //advancedtable1 is the table id 然后我添加了这个 rows_always_visible:[2,totRowIndex] 到表格道具,其中 2 是我希望始终看到的第 th 行,totRowIndex 是页脚行。

    【讨论】:

      猜你喜欢
      • 2019-04-06
      • 2015-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-11
      • 2012-05-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多