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 -%>
IDTitleDescriptionArchivedDue Date
21-40 / 500 show all
21et rerum laborumVelit consequatur quas sunt perspiciatis quae nihil.No2016-04-29Edit
22etReiciendis non officia aut omnis quia minima.No2016-08-28Edit
23exercitationem autVoluptatum aut earum at est deserunt.No2016-05-21Edit
24voluptate culpaEt velit ut libero dolores.No2016-06-24Edit
25ab quiFugit id error esse.No2016-05-03Edit
26quia mollitia delenitiFugit voluptatem recusandae soluta voluptatum consequuntur est voluptatem quas.No2016-06-09Edit
27eum velUllam tenetur culpa error fugit sunt.No2016-05-29Edit
28laborum enim voluptasDignissimos sed laudantium in consequatur quaerat molestias optio maxime.No2016-05-23Edit
29etEst nesciunt accusantium repudiandae est officia ipsa.No2016-07-03Edit
30corrupti molestiae abRepellat ipsa quis quam alias dolores itaque.No2016-03-02Edit
31debitis pariatur illoTemporibus velit id et porro dolor.Yes2016-08-29Edit
32voluptatem ipsam liberoBlanditiis omnis enim voluptas fugit molestiae.No2016-09-19Edit
33voluptatemDolorem saepe et aspernatur.No2016-06-11Edit
34illo voluptasEsse et fuga voluptate eveniet qui.No2016-07-02Edit
35modiAnimi quod iste sunt.Yes2016-05-08Edit
36placeatQuia aut eligendi aliquid.No2016-05-29Edit
37etIncidunt eum consequatur qui et quis.No2016-06-06Edit
38minima doloribus sedEst ipsum aut quam libero dolorem praesentium ut repellendus.No2016-10-16Edit
39praesentium et idExpedita laborum incidunt natus.No2016-03-27Edit
40dolorSapiente voluptas aspernatur non nulla illo aperiam et.No2016-05-14Edit

Fork me on GitHub