WiceGrid 3.6.0.pre4 examples

Saved queries: simple example

Read SAVED_QUERIES_HOWTO.rdoc for details.

  • # encoding: utf-8
    class SavedQueriesController < ApplicationController
      def index
        @tasks_grid = initialize_grid(Task,
          include: [:priority, :status, :project, :assigned_users],
          order: 'statuses.name',
          custom_order: {
            'tasks.priority_id' => 'priorities.name',
            'tasks.status_id' => 'statuses.position',
            'tasks.project_id' => 'projects.name'
          }
        )
      end
    end
    
  • .well
      %h2= current_page_title
      %p
        Read
        %code SAVED_QUERIES_HOWTO.rdoc
        for details.
    
    = show_code
    
    .row-fluid
      .col-md-6
    
        = saved_queries_panel(@tasks_grid, confirm:  false)
    
    = render   'grid'
    
  • <%= grid(@tasks_grid, show_filters: :always) do |g|
    
      g.column name:  'ID', attribute: 'id', filter: false
    
      g.column name:  'Title', attribute: 'title'
    
      g.column name:  'Priority', attribute: 'priority_id', custom_filter: Priority.to_dropdown do |task|
        task.priority.name if task.priority
      end
    
      g.column name:  'Status', attribute: 'status_id', custom_filter: Status.to_dropdown  do |task|
        task.status.name if task.status
      end
    
      g.column name:  'Project Name', attribute: 'project_id', custom_filter: Project.to_dropdown do |task|
        task.project.name if task.project
      end
    
      g.column  name:  'Archived', attribute: 'archived' do |task|
        task.archived? ? 'Yes' : 'No'
      end
    
      g.column name:  'Added', attribute: 'created_at' do |task|
        task.created_at.to_s(:db)
      end
    
      g.column   do |task|
        link_to('Edit', edit_task_path(task))
      end
    end -%>

Opgeslagen query's

IDTitlePriorityStatusProject NameArchivedAdded

61-80 / 500 Alle rijen tonen
22etAnecdoticCancelledSuper GameNo2015-05-19 12:37:19Edit
42autHighCancelledUltimate WebsiteNo2015-04-08 12:37:19Edit
47temporibus iure delectusLowCancelledUltimate WebsiteNo2015-04-22 12:37:19Edit
48qui inciduntLowCancelledDivine FirmwareNo2015-04-04 12:37:19Edit
51harum qui possimusAnecdoticCancelledDivine FirmwareNo2015-04-26 12:37:19Edit
90commodi et quisHighCancelledDivine FirmwareNo2015-04-27 12:37:20Edit
93autCancelledSuper GameNo2015-04-04 12:37:20Edit
103molestiaeAnecdoticCancelledDivine FirmwareNo2015-06-08 12:37:20Edit
125nihil eum minusHighCancelledSuper GameNo2015-04-29 12:37:20Edit
132quiaAnecdoticCancelledUltimate WebsiteNo2015-03-17 12:37:20Edit
135dignissimos idLowCancelledSuper GameNo2015-04-11 12:37:20Edit
136exercitationem distinctio quiCancelledDivine FirmwareNo2015-03-14 12:37:20Edit
159ut maioresHighCancelledSuper GameNo2015-05-09 12:37:21Edit
175aperiam omnisCancelledUltimate WebsiteNo2015-05-02 12:37:21Edit
180cupiditate tenetur omnisCancelledDivine FirmwareNo2015-06-17 12:37:21Edit
82utLowCancelledDivine FirmwareNo2015-06-04 12:37:20Edit
31debitis pariatur illoCancelledUltimate WebsiteYes2015-05-18 12:37:19Edit
21et rerum laborumCancelledSuper GameNo2015-03-19 12:37:18Edit
55dolorLowCancelledSuper GameNo2015-06-11 12:37:19Edit
67officia quo maioresAnecdoticCancelledSuper GameNo2015-06-15 12:37:19Edit

Fork me on GitHub