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
    
  • <%= 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 -%>
  • .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'
    

Requêtes sauvées

IDTitlePriorityStatusProject NameArchivedAdded

461-480 / 500 Voir tous
206quia ipsum maximeVerifiedUltimate WebsiteNo2015-03-12 12:37:21Edit
250id culpa aliquidNormalVerifiedDivine FirmwareNo2015-04-04 12:37:22Edit
258quia fugiatHighVerifiedSuper GameNo2015-06-09 12:37:22Edit
261cumque voluptasLowVerifiedDivine FirmwareNo2015-04-05 12:37:22Edit
291odio fugit etLowVerifiedDivine FirmwareNo2015-06-16 12:37:23Edit
292excepturi hicLowVerifiedUltimate WebsiteNo2015-05-24 12:37:23Edit
294fugiat evenietNormalVerifiedUltimate WebsiteNo2015-06-08 12:37:23Edit
296cupiditate in minimaVerifiedDivine FirmwareYes2015-05-02 12:37:23Edit
305dolorem harumHighVerifiedSuper GameNo2015-04-19 12:37:23Edit
306omnis voluptatem abAnecdoticVerifiedDivine FirmwareNo2015-05-13 12:37:23Edit
318beataeVerifiedDivine FirmwareNo2015-03-13 12:37:23Edit
323doloribusUrgentVerifiedDivine FirmwareNo2015-06-15 12:37:23Edit
327inventoreUrgentVerifiedDivine FirmwareNo2015-04-08 12:37:23Edit
328earumUrgentVerifiedUltimate WebsiteNo2015-04-26 12:37:23Edit
332autem etVerifiedSuper GameNo2015-04-15 12:37:23Edit
335maximeLowVerifiedDivine FirmwareNo2015-03-22 12:37:23Edit
309architecto esse autLowVerifiedUltimate WebsiteNo2015-05-25 12:37:23Edit
192eumVerifiedUltimate WebsiteNo2015-06-19 12:37:21Edit
207sunt laborum cupiditateLowVerifiedSuper GameNo2015-04-13 12:37:21Edit
208officiaAnecdoticVerifiedUltimate WebsiteNo2015-04-17 12:37:22Edit

Fork me on GitHub