lib/wice/helpers/wice_grid_serialized_queries_view_helpers.rb
# View helper to render the list of saved queries and the form to create a new query.
# Parameters:
# * <tt>:extra_parameters</tt> -  a hash of additional parameters to use when creating a new query object.
# * <tt>:confirm</tt> -  A boolean value which turns on or off the JS confirm dialogs when deleting saved queries.
# Read section "Adding Application Specific Logic to Saving/Restoring Queries" in README for more details.
View helper to render the list of saved queries and the form to create a new query.
Parameters:
:extra_parameters -  a hash of additional parameters to use when creating a new query object.
:confirm -  A boolean value which turns on or off the JS confirm dialogs when deleting saved queries.
Read section "Adding Application Specific Logic to Saving/Restoring Queries" in README for more details.
View helper to render the list of saved queries and the form to create a new query . Parameters : : extra_parameters - a hash of additional parameters to use when creating a new query object . : confirm - A boolean value which turns on or off the JS confirm dialogs when deleting saved queries . Read section " Adding Application Specific Logic to Saving / Restoring Queries " in README for more details .
def saved_queries_list(grid_name, saved_query = nil, extra_parameters = {}, confirm = 1)  
      link_title            = NlMessage['saved_query_link_title']
      deletion_confirmation = confirm ? NlMessage['saved_query_deletion_confirmation'] : nil
      deletion_link_title   = NlMessage['saved_query_deletion_link_title']
      query_store_model = ::Wice.get_query_store_model
      currently_loaded_query_id = saved_query ? saved_query.id : nil
      %(<ul id="#{grid_name}_query_list" class="query-list"> ) +
        query_store_model.list(grid_name, controller).collect do |sq|
          link_opts = {
            class: 'wice-grid-query-load-link',
            title: "#{link_title} #{sq.name}",
            'data-query-id' => sq.id,
            'data-grid-name' => grid_name
          }
          link_opts[:class] += ' current' if saved_query == sq
          '<li>' + link_to(
            content_tag(:i, '', class: 'fa fa-trash-o delete-icon'),
            delete_serialized_query_path(
              grid_name: grid_name,
              id:        sq.id,
              current:   currently_loaded_query_id,
              extra:     extra_parameters,
              confirm:   confirm
            ),
            class:               'wice-grid-delete-query',
            'data-wg-confirm' => deletion_confirmation,
            'data-grid-name'  => grid_name,
            title:               "#{deletion_link_title} #{sq.name}"
          ) + ' &nbsp; ' +
            link_to(h(sq.name), '#', link_opts) +
            if sq.respond_to? :description
              desc = sq.description
              desc.blank? ? '' : " <i>#{desc}</i>"
            else
              ''
            end +
            '</li>'
        end.join('') + '</ul>'
    end
def saved_queries_list ( grid_name , saved_query = nil , extra_parameters = { } , confirm = 1 ) link_title = NlMessage [ 'saved_query_link_title' ] deletion_confirmation = confirm ? NlMessage [ 'saved_query_deletion_confirmation' ] : nil deletion_link_title = NlMessage [ 'saved_query_deletion_link_title' ] query_store_model = :: Wice . get_query_store_model currently_loaded_query_id = saved_query ? saved_query . id : nil %(<ul id="#{grid_name}_query_list" class="query-list"> ) + query_store_model . list ( grid_name , controller ) . collect do | sq | link_opts = { class : 'wice-grid-query-load-link' , title : "#{link_title} #{sq.name}" , 'data-query-id' => sq . id , 'data-grid-name' => grid_name } link_opts [ :class ] += ' current' if saved_query == sq '<li>' + link_to ( content_tag ( :i , '' , class : 'fa fa-trash-o delete-icon' ) , delete_serialized_query_path ( grid_name : grid_name , id : sq . id , current : currently_loaded_query_id , extra : extra_parameters , confirm : confirm ) , class : 'wice-grid-delete-query' , 'data-wg-confirm' => deletion_confirmation , 'data-grid-name' => grid_name , title : "#{deletion_link_title} #{sq.name}" ) + ' &nbsp; ' + link_to ( h ( sq . name ) , '#' , link_opts ) + if sq . respond_to? :description desc = sq . description desc . blank? ? '' : " <i>#{desc}</i>" else '' end + '</li>' end . join ( '' ) + '</ul>' end
View helper to render the list of saved queries and the form to create a new query.
View helper to render the list of saved queries and the form to create a new query .
#:nodoc: # with = extra_parameters.nil? ? nil : "'"  + {extra: extra_parameters}.to_query + "'"
grid_name
saved_query
extra_parameters
confirm