2015-04-08 5 views
0

Я использую bs_grid для представления данных из БД. Я хочу скрыть кнопку фильтров по умолчанию, так как я ее не использую, но, похоже, сложно найти какой-либо предыдущий вопрос или какое-то указание.Как скрыть/удалить кнопку фильтров из bs_grid

Любая помощь приветствуется.

EDIT: JQuery плагин использовать один DIV представить все Wich сетки высчитывают на основе некоторых начальных настроек

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

Я проанализировал HTML код, созданный с помощью плагина

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

Я нашел обходной путь, который решает мою проблему. Я использовал css, чтобы скрыть кнопку. здесь находится код

#filter_toggle_cliente_grid { 
    display: none; 
} 
Смежные вопросы