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
481-500 / 500 Alle rijen tonen
481etEveniet repellendus necessitatibus nam neque.No2016-10-23Edit
482consequuntur eumMaiores quo voluptatibus rerum ipsam consequatur.No2016-06-05Edit
483laborum dictaVeniam reiciendis laboriosam voluptas accusamus qui.No2016-02-28Edit
484quiaMolestias ut reprehenderit ipsum quod corporis dolore debitis iste.No2016-05-31Edit
485ut teneturEos corporis voluptate ex sed totam.No2016-10-13Edit
486enim harum minimaEum dolore ut natus.No2016-09-25Edit
487natus etVoluptatibus mollitia corporis est numquam eum.No2016-01-31Edit
488doloribus veritatisMagni sunt illum deserunt impedit maiores natus.No2016-04-06Edit
489voluptatemExcepturi voluptas molestias aspernatur corporis.No2016-01-31Edit
490maximeIncidunt ducimus iste illum inventore nostrum.No2016-04-10Edit
491modi nesciuntLaboriosam voluptatem sunt quod voluptatum magnam quisquam.No2016-05-10Edit
492sed atInventore ipsum qui rerum cum reiciendis nisi.No2016-06-14Edit
493estCorporis vel omnis et quam illo.No2016-02-06Edit
494fugiat quaeratIncidunt laborum voluptas cumque et pariatur.No2016-06-10Edit
495qui ut inQuis ut eos a et.No2016-10-08Edit
496velit non pariaturQuia possimus rerum eum architecto.Yes2016-09-06Edit
497impedit quoQuod earum illum voluptatem.No2016-07-09Edit
498sedQui sint eos distinctio vel assumenda sed animi quae.Yes2016-07-07Edit
499voluptatemMagnam accusantium id aut et quaerat praesentium eveniet.No2016-06-19Edit
500vel eaEt a ut cum eos sed.Yes2016-03-30Edit

Fork me on GitHub