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

481-500 / 500 Alle rijen tonen
336aut quis aspernaturLowVerifiedSuper GameNo2015-03-24 12:37:23Edit
339quia doloremqueHighVerifiedDivine FirmwareNo2015-05-29 12:37:23Edit
348inventore sedVerifiedSuper GameNo2015-03-21 12:37:24Edit
373commodiVerifiedSuper GameNo2015-04-13 12:37:24Edit
403et praesentium temporeUrgentVerifiedUltimate WebsiteNo2015-05-01 12:37:25Edit
407similique voluptatumVerifiedUltimate WebsiteNo2015-05-08 12:37:25Edit
417provident eumHighVerifiedSuper GameNo2015-05-26 12:37:25Edit
439namVerifiedDivine FirmwareNo2015-05-23 12:37:25Edit
444asperiores quisLowVerifiedSuper GameYes2015-04-09 12:37:26Edit
460consequatur nemoHighVerifiedUltimate WebsiteNo2015-04-10 12:37:26Edit
466autAnecdoticVerifiedDivine FirmwareNo2015-03-19 12:37:26Edit
473voluptatum quiVerifiedUltimate WebsiteNo2015-06-11 12:37:26Edit
479provident exUrgentVerifiedSuper GameNo2015-05-02 12:37:26Edit
483laborum dictaLowVerifiedSuper GameNo2015-05-09 12:37:26Edit
493estVerifiedDivine FirmwareNo2015-05-28 12:37:27Edit
495qui ut inAnecdoticVerifiedUltimate WebsiteNo2015-04-21 12:37:27Edit
376assumendaVerifiedSuper GameNo2015-05-22 12:37:24Edit
369reprehenderit rerumLowVerifiedSuper GameNo2015-06-15 12:37:24Edit
360similique estLowVerifiedDivine FirmwareNo2015-06-10 12:37:24Edit
422harum enimAnecdoticVerifiedSuper GameNo2015-04-25 12:37:25Edit

Fork me on GitHub