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 -%>
ID TitleDescriptionArchivedDue Date
1-20 / 500 Sýna allt
1impedit aperiam liberoEst necessitatibus tempora ut.No2016-07-27Edit
2ut sintAssumenda ut in commodi nihil ratione odio voluptatibus ea.No2016-10-21Edit
3aliquam repudiandaeConsequatur iste similique dolorum ducimus ut.No2016-04-20Edit
4nisi quiQuas assumenda eos molestiae recusandae eveniet sit sint.No2016-05-16Edit
5dicta pariaturCorporis iure repellat fuga omnis alias iusto aut voluptatum.No2016-03-04Edit
6molestiae autemExplicabo aut ratione omnis voluptatem officia itaque dicta aut.Yes2016-10-26Edit
7ut veniamMolestiae qui qui quo occaecati.No2016-08-04Edit
8nullaNatus sint inventore culpa fugiat occaecati est distinctio.No2016-05-22Edit
9quisquam in isteEt fugiat blanditiis facilis asperiores et.No2016-03-07Edit
10rerum occaecatiCum aperiam voluptas aut.No2016-08-14Edit
11aspernatur estVoluptatem error inventore officia rem nemo qui.Yes2016-06-21Edit
12explicabo hicPorro in nisi ea sunt consequatur est incidunt et.No2016-04-15Edit
13utEst voluptas impedit perferendis excepturi aliquid doloremque.No2016-07-18Edit
14repellat consequatur velitError autem et deleniti nihil maxime voluptatem eius eveniet.No2016-01-10Edit
15est ut autVero distinctio voluptatem veritatis.No2016-10-30Edit
16omnisPossimus voluptas tempore sed mollitia neque vero nesciunt.No2016-02-05Edit
17itaque suscipit commodiEt ut eveniet deleniti voluptatem omnis ea magnam et.No2016-08-23Edit
18necessitatibus commodiLabore dolor et cumque quos.No2016-03-28Edit
19id rem eaIn odio quia laborum quam dicta nulla.Yes2016-04-14Edit
20aspernatur eligendi adipisciMaiores perspiciatis tempore et aut sapiente eaque.No2016-06-08Edit

Fork me on GitHub