WiceGrid 3.6.0.pre4 examples

External submit/reset buttons

To replace the default Submit and Reset icons of the grid, add class wg-external-submit-button to any clickable element on page and set its attribute data-grid-name to the name of the grid. Do the same for the Reset button with class wg-external-reset-button.

grid helper parameters hide_submit_button: true and hide_reset_button: true hide the default icons.

  • # encoding: utf-8
    class ButtonsController < ApplicationController
      def index
        @tasks_grid = initialize_grid(Task)
      end
    end
    
  • .well
      %h2= current_page_title
      %p
    
        To replace the default Submit and Reset icons of the grid, add class
        %code wg-external-submit-button
        to any clickable element on page and set its attribute
        %code data-grid-name
        to the name of the grid.
        Do the same for the Reset button with class
        %code wg-external-reset-button.
    
      %p
        %code grid
        helper parameters
        %code hide_submit_button: true
        and
        %code hide_reset_button: true
        hide the default icons.
    
    = show_code
    
    .row-fluid
      .col-md-12
        .external-buttons
          %button.btn.btn-primary.wg-external-submit-button{'data-grid-name' => 'grid'} Submit
          %button.btn.btn-default.wg-external-reset-button{'data-grid-name' => 'grid'} Reset
    
    
        = render   'grid'
  • <%= grid(@tasks_grid, hide_submit_button: true, hide_reset_button: true) do |g|
    
      g.column name:  'ID', attribute: 'id', filter: false
    
      g.column name:  'Title', attribute: 'title'
    
      g.column  name:  'Description', attribute: 'description'
    
      g.column  name:  'Archived', attribute: 'archived' do |task|
        task.archived? ? 'Yes' : 'No'
      end
    
      g.column name:  'Due Date', attribute: 'due_date', filter: false
    
    
      g.column   do |task|
        link_to('Edit', edit_task_path(task))
      end
    
    end -%>
IDTitle DescriptionArchivedDue Date
1-20 / 500 Voir tous
25ab quiFugit id error esse.No2016-05-03Edit
63accusamusPraesentium quod ipsum error odit.No2016-09-17Edit
436accusantiumCorrupti qui mollitia temporibus.No2016-10-01Edit
426accusantium eligendiDebitis dolore id eos tempora.No2016-09-01Edit
370accusantium error exercitationemMolestiae eos quibusdam quod id voluptatem eius.No2016-01-24Edit
168adDolorum id sint assumenda quos consectetur aut eveniet.No2016-10-06Edit
86adipisciConsectetur optio rerum facilis explicabo enim consequatur delectus iste.No2016-02-07Edit
346adipisci at nesciuntEligendi facilis ut consequatur.No2016-10-14Edit
146adipisci etIncidunt porro iure esse.Yes2016-03-01Edit
147adipisci ut asperioresSed sed ullam blanditiis aut consequatur mollitia ipsam et.No2016-08-24Edit
81ad quo dolorTempora culpa laborum et illum suscipit facilis earum et.No2016-05-18Edit
59alias liberoRepudiandae praesentium aut nobis saepe.No2016-01-09Edit
3aliquam repudiandaeConsequatur iste similique dolorum ducimus ut.No2016-04-20Edit
188aliquid adipisciEaque maxime mollitia in vel.No2016-08-15Edit
139aliquid oditOccaecati veritatis asperiores vitae aut.No2016-10-11Edit
230aliquid rerum modiFugit hic blanditiis esse alias.Yes2016-07-20Edit
215aliquid sed suntQuis sed voluptate voluptatibus voluptatem doloremque et.Yes2016-07-29Edit
79animiCorporis est inventore nesciunt est nam voluptas et.No2016-05-06Edit
447animi accusantium utSequi dolorem distinctio sit doloremque et corporis voluptatem alias.No2016-10-15Edit
175aperiam omnisNisi qui itaque quia quaerat.No2016-04-17Edit

Fork me on GitHub