2015-04-08 89 views
0

我正在使用bs_grid來顯示數據庫中的數據。我想隱藏默認過濾器按鈕,因爲我不使用它,但似乎很難找到任何以前的問題或某種跡象。如何從bs_grid中隱藏/刪除過濾器按鈕

任何幫助表示讚賞。

編輯:jquery插件使用單個div來呈現所有網格至極是基於一些初始設置計算

HTML代碼:

<div id="cliente_grid"></div> 

JS代碼:

$(function() { 

$("#cliente_grid").bs_grid({ 

    ajaxFetchDataURL: "ajax/ajax_fetch_cliente_data.php", 
    row_primary_key: "ID_anagrafica_clienti", 
    columns: [ 
     {field: "ID_anagrafica_clienti", header: "Code", visible: "no"}, 
     {field: "Codice_Fiscale", header: "Codice Fiscale"}, 
     {field: "Cognome", header: "Cognome"}, 
     {field: "Nome", header: "Nome"}, 
     {field: "Sesso", header: "Sesso"}, 
     {field: "Data_nascita", header: "Data nascita"}, 
     {field: "Comune_nascita", header: "Comune nascita", visible: "no"}, 
     {field: "Pv_nascita", header: "Pv nascita", visible: "no"} 
    ], 

    sorting: [ 
     {sortingName: "Code", field: "ID_anagrafica_clienti", order: "none"}, 
     {sortingName: "Codice Fiscale", field: "Codice_Fiscale", order: "ascending"}, 
     {sortingName: "Cognome", field: "Cognome", order: "ascending"}, 
     {sortingName: "Nome", field: "Nome", order: "ascending"}, 
     {sortingName: "Sesso", field: "Sesso", order: "ascending"}, 
     {sortingName: "Data nascita", field: "Data_nascita", order: "none"}, 
     {sortingName: "Comune nascita", field: "Comune_nascita", order: "ascending"}, 
     {sortingName: "Pv nascita", field: "Pv_nascita", order: "ascending"} 
    ], 
/* 
    filterOptions: { 
     filters: [ 
      { 
       filterName: "Codice_Fiscale", "filterType": "text", field: "Codice_Fiscale", filterLabel: "Codice Fiscale", 
       excluded_operators: ["in", "not_in"], 
       filter_interface: [ 
        { 
         filter_element: "input", 
         filter_element_attributes: {"type": "text"} 
        } 
       ] 
      }, 
      { 
       filterName: "Cognome", "filterType": "text",field: "Cognome", filterLabel: "Cognome", 
       excluded_operators: ["equal", "not_equal", "less", "less_or_equal", "greater", "greater_or_equal"], 
       filter_interface: [ 
        { 
         filter_element: "input", 
         filter_element_attributes: {type: "text"} 
        } 
       ], 
      }, 
      { 
       filterName: "Gender", "filterType": "number", "numberType": "integer", field: "lk_genders_id", filterLabel: "Gender", 
       excluded_operators: ["equal", "not_equal", "less", "less_or_equal", "greater", "greater_or_equal"], 
       filter_interface: [ 
        { 
         filter_element: "input", 
         filter_element_attributes: {type: "checkbox"} 
        } 
       ], 
       lookup_values: [ 
        {lk_option: "Male", lk_value: "1"}, 
        {lk_option: "Female", lk_value: "2", lk_selected: "yes"} 
       ] 
      }, 

      { 
       filterName: "DateUpdated", "filterType": "date", field: "date_updated", filterLabel: "Datetime updated", 
       excluded_operators: ["in", "not_in"], 
       filter_interface: [ 
        { 
         filter_element: "input", 
         filter_element_attributes: { 
          type: "text", 
          title: "Set the date and time using format: dd/mm/yyyy hh:mm:ss" 
         }, 
         filter_widget: "datetimepicker", 
         filter_widget_properties: { 
          dateFormat: "dd/mm/yy", 
          timeFormat: "HH:mm:ss", 
          changeMonth: true, 
          changeYear: true, 
          showSecond: true 
         } 
        } 
       ], 
       validate_dateformat: ["DD/MM/YYYY HH:mm:ss"], 
       filter_value_conversion: { 
        function_name: "local_datetime_to_UTC_timestamp", 
        args: [ 
         {"filter_value": "yes"}, 
         {"value": "DD/MM/YYYY HH:mm:ss"} 
        ] 
       } 
      } 
     ] 
    } 
    */ 
}); 

}); 

從代碼中可以看出,沒有任何跡象表明,某些財產或任何其他事物,並且在矽統上並沒有這麼好(我搜查了很長時間但從未建立過,也許我錯了?)

+1

顯示一些代碼你試過了嗎?讚賞 –

+0

如果你按照鏈接,你會看到沒有太多的嘗試......這是問題。我找不到任何東西來嘗試:( – Alex75

回答

0

我分析了該插件

<button id="filter_toggle_cliente_grid" class="btn btn-default pull-right" title="Filters"><span class="glyphicon glyphicon-filter"></span></button> 

生成的HTML代碼,我發現,解決我的問題解決方法。我用CSS來隱藏按鈕。這裏是代碼

#filter_toggle_cliente_grid { 
    display: none; 
} 
相關問題