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
    
  • <%= 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 -%>
  • .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'
IDTitleDescriptionArchived Due Date
461-480 / 500 Alle rijen tonen
253quosAut fuga qui excepturi ut tempora dolor voluptatem.Yes2016-01-08Edit
254ex estIpsa enim provident quia.Yes2016-02-11Edit
19id rem eaIn odio quia laborum quam dicta nulla.Yes2016-04-14Edit
111sit eaCulpa numquam dolorem corporis corrupti aliquam.Yes2016-04-07Edit
414quo architecto nonLaudantium iusto dolor facere vero provident sunt.Yes2016-01-07Edit
452illum et voluptatemAccusamus quis quis sapiente distinctio aut et quaerat asperiores.Yes2016-02-03Edit
416ipsamSit dolore accusantium maxime.Yes2016-07-14Edit
498sedQui sint eos distinctio vel assumenda sed animi quae.Yes2016-07-07Edit
393nihilAut non incidunt omnis assumenda.Yes2016-06-18Edit
379vero repellatUt sed id deserunt.Yes2016-03-31Edit
469natus autemSed deleniti iste et eos magnam delectus in sequi.Yes2016-10-08Edit
419voluptatem rerumOmnis eos labore nulla temporibus provident ratione sed excepturi.Yes2016-01-24Edit
230aliquid rerum modiFugit hic blanditiis esse alias.Yes2016-07-20Edit
231quia quisCupiditate error facilis qui nobis modi hic.Yes2016-10-17Edit
31debitis pariatur illoTemporibus velit id et porro dolor.Yes2016-08-29Edit
496velit non pariaturQuia possimus rerum eum architecto.Yes2016-09-06Edit
233nesciunt suscipit quisDicta vel atque occaecati quisquam qui est tempora.Yes2016-05-23Edit
367similiqueNeque fuga recusandae expedita omnis et.Yes2016-04-10Edit
35modiAnimi quod iste sunt.Yes2016-05-08Edit
350et quoRerum rem quos officiis molestias earum pariatur.Yes2016-10-14Edit

Fork me on GitHub