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
461-480 / 500 Alle rijen tonen
461dolor voluptasItaque quibusdam repellat in.No2016-06-06Edit
462provident doloremque laudantiumVoluptas nihil enim placeat.No2016-01-22Edit
463excepturiNobis doloribus eos aut voluptatem eaque.No2016-08-22Edit
464culpaError deleniti qui quaerat sint.No2016-04-17Edit
465totamQui adipisci aspernatur qui non.No2016-03-14Edit
466autIllum corporis occaecati quia quo aut ratione voluptatem.No2016-03-21Edit
467in error praesentiumEarum temporibus quae laudantium.No2016-02-04Edit
468officiisUt a qui quod saepe unde excepturi.No2016-02-28Edit
469natus autemSed deleniti iste et eos magnam delectus in sequi.Yes2016-10-08Edit
470et nonQuia eaque consequatur minima ut pariatur.No2016-07-25Edit
471illo ut evenietSed esse et sit qui iste odit sint ex.No2016-05-09Edit
472perspiciatisNihil qui dolore dignissimos dicta.No2016-03-13Edit
473voluptatum quiBlanditiis quisquam ut eos eum.No2016-03-22Edit
474possimusAut quia quia a et assumenda voluptas.No2016-06-30Edit
475rerum perspiciatis eumSoluta non et temporibus.No2016-06-25Edit
476facere voluptasOccaecati consectetur neque ullam dolores qui.Yes2016-03-14Edit
477et corruptiLabore non ab accusamus culpa aliquam dicta eaque.No2016-06-10Edit
478necessitatibusQui omnis tempora velit.No2016-03-17Edit
479provident exMolestias animi adipisci sed qui sit ducimus ut et.No2016-10-25Edit
480quas sapiente rerumQuos aut dolor error nihil at placeat quia id.No2016-07-10Edit

Fork me on GitHub