compass-jquery-plugin 0.3.0.0 → 0.3.1.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +69 -13
- data/Rakefile +1 -1
- data/VERSION.yml +2 -2
- data/gem_tasks/jqgrid.rake +119 -0
- data/gem_tasks/jrails.rake +78 -77
- data/gem_tasks/mobile.rake +156 -0
- data/gem_tasks/rubygems.rake +5 -1
- data/gem_tasks/secret_sauce.rake +64 -0
- data/lib/jquery/gridify.rb +42 -0
- data/lib/jquery/gridify/assertions.rb +37 -0
- data/lib/jquery/gridify/grid.rb +210 -0
- data/lib/jquery/gridify/grid_column.rb +134 -0
- data/lib/jquery/gridify/grid_finder.rb +223 -0
- data/lib/jquery/gridify/grid_options.rb +279 -0
- data/lib/jquery/gridify/grid_view.rb +435 -0
- data/lib/jquery/jqgrid.rb +5 -0
- data/lib/jquery/jqgrid/jqgrid.rb +438 -0
- data/lib/jquery/mobile.rb +3 -0
- data/lib/jquery/secret_sauce.rb +9 -0
- data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +14 -0
- data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +18 -0
- data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +6 -0
- data/lib/jquery/secret_sauce/helpers/ui_form_helper.rb +118 -0
- data/lib/jquery/secret_sauce/helpers/ui_grid_helper.rb +226 -0
- data/lib/jquery/secret_sauce/model/find_for_grid.rb +42 -0
- data/templates/dynatree/jquery.dynatree.js +258 -147
- data/templates/dynatree/jquery.dynatree.min.js +81 -79
- data/templates/dynatree/jquery/dynatree/aero.scss +35 -18
- data/templates/dynatree/jquery/dynatree/aero/drop_sibling_here.png +0 -0
- data/templates/dynatree/jquery/dynatree/aqua.scss +36 -19
- data/templates/dynatree/jquery/dynatree/aqua/drop_sibling_here.png +0 -0
- data/templates/dynatree/jquery/dynatree/crystal.scss +38 -21
- data/templates/dynatree/jquery/dynatree/crystal/drop_sibling_here.png +0 -0
- data/templates/dynatree/jquery/dynatree/xp.scss +59 -42
- data/templates/dynatree/jquery/dynatree/xp/drop_sibling_here.png +0 -0
- data/templates/dynatree/manifest.rb +4 -0
- data/templates/jqgrid/config/initializers/jqgrid.rb +4 -0
- data/templates/jqgrid/config/locales/jquery/jqgrid/de.yml +7 -0
- data/templates/jqgrid/config/locales/jquery/jqgrid/en.yml +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-bg.js +132 -0
- data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +132 -0
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-cat.js +128 -0
- data/templates/jqgrid/i18n/jqgrid/locale-cat.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +132 -0
- data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +5 -0
- data/templates/jqgrid/i18n/jqgrid/locale-cs.js +128 -0
- data/templates/jqgrid/i18n/jqgrid/locale-cs.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-da.js +128 -0
- data/templates/jqgrid/i18n/jqgrid/locale-da.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +133 -0
- data/templates/jqgrid/i18n/jqgrid/locale-de.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-el.js +126 -0
- data/templates/jqgrid/i18n/jqgrid/locale-el.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-en.js +128 -0
- data/templates/jqgrid/i18n/jqgrid/locale-en.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-es.js +128 -0
- data/templates/jqgrid/i18n/jqgrid/locale-es.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-fa.js +125 -0
- data/templates/jqgrid/i18n/jqgrid/locale-fa.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +130 -0
- data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +126 -0
- data/templates/jqgrid/i18n/jqgrid/locale-fr.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-gl.js +126 -0
- data/templates/jqgrid/i18n/jqgrid/locale-gl.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-he.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-he.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-hu.js +129 -0
- data/templates/jqgrid/i18n/jqgrid/locale-hu.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +126 -0
- data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-it.js +1 -0
- data/templates/jqgrid/i18n/jqgrid/locale-it.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ja.js +155 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ja.min.js +5 -0
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +149 -0
- data/templates/jqgrid/i18n/jqgrid/locale-nl.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-no.js +1 -0
- data/templates/jqgrid/i18n/jqgrid/locale-no.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-pl.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-pl.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-pt.js +125 -0
- data/templates/jqgrid/i18n/jqgrid/locale-pt.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ro.js +139 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ro.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ru.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ru.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-sk.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-sr.js +128 -0
- data/templates/jqgrid/i18n/jqgrid/locale-sr.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-sv.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-sv.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +126 -0
- data/templates/jqgrid/i18n/jqgrid/locale-tr.min.js +6 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ua.js +127 -0
- data/templates/jqgrid/i18n/jqgrid/locale-ua.min.js +7 -0
- data/templates/jqgrid/jquery.jqGrid.js +11604 -0
- data/templates/jqgrid/jquery.jqGrid.min.js +472 -0
- data/templates/jqgrid/jquery/jqGrid.scss +692 -0
- data/templates/jqgrid/manifest.rb +72 -0
- data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +13 -0
- data/templates/jqtouch/jquery/touch/apple.scss +5 -5
- data/templates/jqtouch/jquery/touch/default.scss +5 -5
- data/templates/jqtouch/jquery/touch/jqt.scss +5 -5
- data/templates/jrails/config/initializers/jrails.rb +3 -0
- data/templates/jrails/jquery-ui.js +45 -62
- data/templates/jrails/jquery-ui.min.js +22 -22
- data/templates/jrails/jquery.js +340 -206
- data/templates/jrails/jquery.min.js +152 -151
- data/templates/jrails/jquery.tmpl.js +489 -0
- data/templates/jrails/jquery.tmpl.min.js +12 -0
- data/templates/jrails/jquery.tmplPlus.js +98 -0
- data/templates/jrails/jquery.tmplPlus.min.js +3 -0
- data/templates/jrails/jquery/ui/_theme.scss +3 -1
- data/templates/jrails/manifest.rb +4 -0
- data/templates/jstree/jquery.jstree.js +4479 -4468
- data/templates/jstree/jquery.jstree.min.js +4 -3
- data/templates/mobile/config/initializers/mobile.rb +6 -0
- data/templates/mobile/glyphish/Read me first - license.txt +14 -0
- data/templates/mobile/glyphish/icons-black/01-refresh.png +0 -0
- data/templates/mobile/glyphish/icons-black/02-redo.png +0 -0
- data/templates/mobile/glyphish/icons-black/03-loopback.png +0 -0
- data/templates/mobile/glyphish/icons-black/04-squiggle.png +0 -0
- data/templates/mobile/glyphish/icons-black/05-shuffle.png +0 -0
- data/templates/mobile/glyphish/icons-black/06-magnifying-glass.png +0 -0
- data/templates/mobile/glyphish/icons-black/07-map-marker.png +0 -0
- data/templates/mobile/glyphish/icons-black/08-chat.png +0 -0
- data/templates/mobile/glyphish/icons-black/09-chat2.png +0 -0
- data/templates/mobile/glyphish/icons-black/10-medical.png +0 -0
- data/templates/mobile/glyphish/icons-black/100-coffee.png +0 -0
- data/templates/mobile/glyphish/icons-black/101-gameplan.png +0 -0
- data/templates/mobile/glyphish/icons-black/102-walk.png +0 -0
- data/templates/mobile/glyphish/icons-black/103-map.png +0 -0
- data/templates/mobile/glyphish/icons-black/104-index-cards.png +0 -0
- data/templates/mobile/glyphish/icons-black/105-piano.png +0 -0
- data/templates/mobile/glyphish/icons-black/106-sliders.png +0 -0
- data/templates/mobile/glyphish/icons-black/107-widescreen.png +0 -0
- data/templates/mobile/glyphish/icons-black/108-badge.png +0 -0
- data/templates/mobile/glyphish/icons-black/109-chicken.png +0 -0
- data/templates/mobile/glyphish/icons-black/11-clock.png +0 -0
- data/templates/mobile/glyphish/icons-black/110-bug.png +0 -0
- data/templates/mobile/glyphish/icons-black/111-user.png +0 -0
- data/templates/mobile/glyphish/icons-black/112-group.png +0 -0
- data/templates/mobile/glyphish/icons-black/113-navigation.png +0 -0
- data/templates/mobile/glyphish/icons-black/114-balloon.png +0 -0
- data/templates/mobile/glyphish/icons-black/115-bow-and-arrow.png +0 -0
- data/templates/mobile/glyphish/icons-black/116-controller.png +0 -0
- data/templates/mobile/glyphish/icons-black/117-todo.png +0 -0
- data/templates/mobile/glyphish/icons-black/118-coathanger.png +0 -0
- data/templates/mobile/glyphish/icons-black/119-piggybank.png +0 -0
- data/templates/mobile/glyphish/icons-black/12-eye.png +0 -0
- data/templates/mobile/glyphish/icons-black/120-headphones.png +0 -0
- data/templates/mobile/glyphish/icons-black/121-lanscape.png +0 -0
- data/templates/mobile/glyphish/icons-black/122-stats.png +0 -0
- data/templates/mobile/glyphish/icons-black/123-id-card.png +0 -0
- data/templates/mobile/glyphish/icons-black/124-bullhorn.png +0 -0
- data/templates/mobile/glyphish/icons-black/125-food.png +0 -0
- data/templates/mobile/glyphish/icons-black/126-moon.png +0 -0
- data/templates/mobile/glyphish/icons-black/127-sock.png +0 -0
- data/templates/mobile/glyphish/icons-black/128-bone.png +0 -0
- data/templates/mobile/glyphish/icons-black/129-golf.png +0 -0
- data/templates/mobile/glyphish/icons-black/13-target.png +0 -0
- data/templates/mobile/glyphish/icons-black/130-dice.png +0 -0
- data/templates/mobile/glyphish/icons-black/14-tag.png +0 -0
- data/templates/mobile/glyphish/icons-black/15-tags.png +0 -0
- data/templates/mobile/glyphish/icons-black/16-line-chart.png +0 -0
- data/templates/mobile/glyphish/icons-black/17-bar-chart.png +0 -0
- data/templates/mobile/glyphish/icons-black/18-envelope.png +0 -0
- data/templates/mobile/glyphish/icons-black/19-gear.png +0 -0
- data/templates/mobile/glyphish/icons-black/20-gear2.png +0 -0
- data/templates/mobile/glyphish/icons-black/21-skull.png +0 -0
- data/templates/mobile/glyphish/icons-black/22-skull-n-crossbones.png +0 -0
- data/templates/mobile/glyphish/icons-black/23-bird.png +0 -0
- data/templates/mobile/glyphish/icons-black/24-gift.png +0 -0
- data/templates/mobile/glyphish/icons-black/25-weather.png +0 -0
- data/templates/mobile/glyphish/icons-black/26-bandaid.png +0 -0
- data/templates/mobile/glyphish/icons-black/27-planet.png +0 -0
- data/templates/mobile/glyphish/icons-black/28-star.png +0 -0
- data/templates/mobile/glyphish/icons-black/29-heart.png +0 -0
- data/templates/mobile/glyphish/icons-black/30-key.png +0 -0
- data/templates/mobile/glyphish/icons-black/31-ipod.png +0 -0
- data/templates/mobile/glyphish/icons-black/32-iphone.png +0 -0
- data/templates/mobile/glyphish/icons-black/33-cabinet.png +0 -0
- data/templates/mobile/glyphish/icons-black/34-coffee.png +0 -0
- data/templates/mobile/glyphish/icons-black/35-shopping-bag.png +0 -0
- data/templates/mobile/glyphish/icons-black/36-toolbox.png +0 -0
- data/templates/mobile/glyphish/icons-black/37-suitcase.png +0 -0
- data/templates/mobile/glyphish/icons-black/38-airplane.png +0 -0
- data/templates/mobile/glyphish/icons-black/39-spraycan.png +0 -0
- data/templates/mobile/glyphish/icons-black/40-inbox.png +0 -0
- data/templates/mobile/glyphish/icons-black/41-picture-frame.png +0 -0
- data/templates/mobile/glyphish/icons-black/42-photos.png +0 -0
- data/templates/mobile/glyphish/icons-black/43-film-roll.png +0 -0
- data/templates/mobile/glyphish/icons-black/44-shoebox.png +0 -0
- data/templates/mobile/glyphish/icons-black/45-movie1.png +0 -0
- data/templates/mobile/glyphish/icons-black/46-movie2.png +0 -0
- data/templates/mobile/glyphish/icons-black/47-fuel.png +0 -0
- data/templates/mobile/glyphish/icons-black/48-fork-and-knife.png +0 -0
- data/templates/mobile/glyphish/icons-black/49-battery.png +0 -0
- data/templates/mobile/glyphish/icons-black/50-beaker.png +0 -0
- data/templates/mobile/glyphish/icons-black/51-outlet.png +0 -0
- data/templates/mobile/glyphish/icons-black/52-pinetree.png +0 -0
- data/templates/mobile/glyphish/icons-black/53-house.png +0 -0
- data/templates/mobile/glyphish/icons-black/54-lock.png +0 -0
- data/templates/mobile/glyphish/icons-black/55-network.png +0 -0
- data/templates/mobile/glyphish/icons-black/56-cloud.png +0 -0
- data/templates/mobile/glyphish/icons-black/57-download.png +0 -0
- data/templates/mobile/glyphish/icons-black/58-bookmark.png +0 -0
- data/templates/mobile/glyphish/icons-black/59-flag.png +0 -0
- data/templates/mobile/glyphish/icons-black/60-signpost.png +0 -0
- data/templates/mobile/glyphish/icons-black/61-brightness.png +0 -0
- data/templates/mobile/glyphish/icons-black/62-contrast.png +0 -0
- data/templates/mobile/glyphish/icons-black/63-runner.png +0 -0
- data/templates/mobile/glyphish/icons-black/64-zap.png +0 -0
- data/templates/mobile/glyphish/icons-black/65-note.png +0 -0
- data/templates/mobile/glyphish/icons-black/66-microphone.png +0 -0
- data/templates/mobile/glyphish/icons-black/67-tshirt.png +0 -0
- data/templates/mobile/glyphish/icons-black/68-paperclip.png +0 -0
- data/templates/mobile/glyphish/icons-black/69-display.png +0 -0
- data/templates/mobile/glyphish/icons-black/70-tv.png +0 -0
- data/templates/mobile/glyphish/icons-black/71-compass.png +0 -0
- data/templates/mobile/glyphish/icons-black/72-pin.png +0 -0
- data/templates/mobile/glyphish/icons-black/73-radar.png +0 -0
- data/templates/mobile/glyphish/icons-black/74-location.png +0 -0
- data/templates/mobile/glyphish/icons-black/75-phone.png +0 -0
- data/templates/mobile/glyphish/icons-black/76-baby.png +0 -0
- data/templates/mobile/glyphish/icons-black/77-ekg.png +0 -0
- data/templates/mobile/glyphish/icons-black/78-stopwatch.png +0 -0
- data/templates/mobile/glyphish/icons-black/79-medical-bag.png +0 -0
- data/templates/mobile/glyphish/icons-black/80-shopping-cart.png +0 -0
- data/templates/mobile/glyphish/icons-black/81-dashboard.png +0 -0
- data/templates/mobile/glyphish/icons-black/82-dogpaw.png +0 -0
- data/templates/mobile/glyphish/icons-black/83-calendar.png +0 -0
- data/templates/mobile/glyphish/icons-black/84-lightbulb.png +0 -0
- data/templates/mobile/glyphish/icons-black/85-trophy.png +0 -0
- data/templates/mobile/glyphish/icons-black/86-camera.png +0 -0
- data/templates/mobile/glyphish/icons-black/87-wineglass.png +0 -0
- data/templates/mobile/glyphish/icons-black/88-beermug.png +0 -0
- data/templates/mobile/glyphish/icons-black/89-dumbbell.png +0 -0
- data/templates/mobile/glyphish/icons-black/90-lifebuoy.png +0 -0
- data/templates/mobile/glyphish/icons-black/91-beaker2.png +0 -0
- data/templates/mobile/glyphish/icons-black/92-testtube.png +0 -0
- data/templates/mobile/glyphish/icons-black/93-thermometer.png +0 -0
- data/templates/mobile/glyphish/icons-black/94-pill.png +0 -0
- data/templates/mobile/glyphish/icons-black/95-equalizer.png +0 -0
- data/templates/mobile/glyphish/icons-black/96-book.png +0 -0
- data/templates/mobile/glyphish/icons-black/97-puzzle.png +0 -0
- data/templates/mobile/glyphish/icons-black/98-palette.png +0 -0
- data/templates/mobile/glyphish/icons-black/99-umbrella.png +0 -0
- data/templates/mobile/glyphish/icons-white/09-chat2.png +0 -0
- data/templates/mobile/glyphish/icons-white/100-coffee.png +0 -0
- data/templates/mobile/glyphish/icons-white/18-envelope.png +0 -0
- data/templates/mobile/glyphish/icons-white/19-gear.png +0 -0
- data/templates/mobile/glyphish/icons-white/21-skull.png +0 -0
- data/templates/mobile/glyphish/icons-white/30-key.png +0 -0
- data/templates/mobile/glyphish/icons-white/34-coffee.png +0 -0
- data/templates/mobile/glyphish/icons-white/88-beermug.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/band-aid.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/chat.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/clock.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/eye.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/flag.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/fork-and-knife.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/gear.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/heart.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/lightning-bolt.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/magnifying-glass.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/map-marker.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/map-pin.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/microphone.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/music-note.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/paw.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/plus.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/puzzle.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/star.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/tag.png +0 -0
- data/templates/mobile/glyphish/mini-icons-black/tshirt.png +0 -0
- data/templates/mobile/jquery.mobile.js +3995 -0
- data/templates/mobile/jquery.mobile.min.js +28 -0
- data/templates/mobile/jquery/mobile/_base.scss +1344 -0
- data/templates/mobile/jquery/mobile/default.scss +745 -0
- data/templates/mobile/jquery/mobile/default/ajax-loader.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-check-off.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-check-on.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-radio-off.png +0 -0
- data/templates/mobile/jquery/mobile/default/form-radio-on.png +0 -0
- data/templates/mobile/jquery/mobile/default/icon-search-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
- data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia.scss +807 -0
- data/templates/mobile/jquery/mobile/valencia/ajax-loader.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-check-off.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-check-on.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-radio-off.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/form-radio-on.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icon-search-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/texture_05.png +0 -0
- data/templates/mobile/jquery/mobile/valencia/texture_075.png +0 -0
- data/templates/mobile/lib/tasks/jquery.mobile.rake +106 -0
- data/templates/mobile/manifest.rb +191 -0
- data/templates/secret_sauce/app/views/shared/_ui_form_error_messages.html.haml +6 -0
- data/templates/secret_sauce/app/views/shared/_ui_grid_for_without_block.js.haml +144 -0
- data/templates/secret_sauce/app/views/shared/_ui_static_dialog.html.haml +6 -0
- data/templates/secret_sauce/config/initializers/secret_sauce.rb +8 -0
- data/templates/secret_sauce/jquery/secret_sauce.scss +33 -0
- data/templates/secret_sauce/manifest.rb +10 -0
- data/templates/secret_sauce/secret_sauce.js +12 -0
- data/templates/secret_sauce/secret_sauce.min.js +1 -0
- metadata +313 -17
- data/.gitignore +0 -22
- data/compass-jquery-plugin.gemspec +0 -1064
@@ -0,0 +1,134 @@
|
|
1
|
+
module Gridify
|
2
|
+
class GridColumn
|
3
|
+
|
4
|
+
attr_accessor :name, # attribute name (required)
|
5
|
+
:label,
|
6
|
+
:ar_column, # active_record column
|
7
|
+
:value_type, # active_record data type :string, :text, :integer, :float, :boolean, + :currency
|
8
|
+
:key, # true if this is the key (only :id)
|
9
|
+
|
10
|
+
# column formatting
|
11
|
+
:width, # initial width (150)
|
12
|
+
:fixed_width, # true = not resized when recalc fit to width
|
13
|
+
:formatter, # see jqGrid doc (based on value_type)
|
14
|
+
:format_options, # hash, see jqGrid doc (based on value_type)
|
15
|
+
:align, # 'left', 'right', 'center' (left for strings, right for numerics)
|
16
|
+
#:classes, # optional classes to add to column
|
17
|
+
|
18
|
+
# column actions
|
19
|
+
:resizable, # t/f (true)
|
20
|
+
:sortable, # t/f (true) or jqGrid sorttype: :integer, :float, :currency, :date, :text (true)
|
21
|
+
:searchable, # true/false (true) or text or select
|
22
|
+
#:search_options,
|
23
|
+
:editable, # true/false (false),
|
24
|
+
:edit_type, # text, textarea, select, checkbox, password, button, image and file (based on value_type)
|
25
|
+
:edit_options, # html input field options, depends on editable type (eg {"size" => 10, "maxlength" => 15}) see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules
|
26
|
+
:validations, # jqGrid editrules (TODO derive from AR model validations) see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules
|
27
|
+
# "required" "integer" "email" "url" etc
|
28
|
+
:form_options, # jqGrid formoptions for formatting input forms
|
29
|
+
# select types
|
30
|
+
#:select_url, # url to dynamically get select options
|
31
|
+
|
32
|
+
# visiblity
|
33
|
+
#:always_hidden, # (false)
|
34
|
+
:sort_type,
|
35
|
+
:summary_type,
|
36
|
+
:summary_tpl,
|
37
|
+
:hidden # initial hide state (false)
|
38
|
+
|
39
|
+
def initialize(options)
|
40
|
+
update options
|
41
|
+
end
|
42
|
+
|
43
|
+
def update(options)
|
44
|
+
options.each {|atr, val| send( "#{atr}=", val )}
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_json
|
48
|
+
properties.to_json #_with_js
|
49
|
+
end
|
50
|
+
|
51
|
+
def properties
|
52
|
+
jqgrid_properties
|
53
|
+
end
|
54
|
+
|
55
|
+
def resizable
|
56
|
+
if @resizable==false
|
57
|
+
false
|
58
|
+
else
|
59
|
+
# true or nil
|
60
|
+
true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def fixed_width
|
65
|
+
if @fixed_width==false
|
66
|
+
false
|
67
|
+
elsif @fixed_width.nil?
|
68
|
+
!resizable
|
69
|
+
else
|
70
|
+
@fixed_width
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# ----------------
|
75
|
+
private
|
76
|
+
|
77
|
+
def jqgrid_type
|
78
|
+
return sortable unless sortable==true
|
79
|
+
case value_type
|
80
|
+
when :string : 'text'
|
81
|
+
when :text : 'text'
|
82
|
+
when :integer : 'integer'
|
83
|
+
when :float : 'float'
|
84
|
+
when :boolean : 'boolean'
|
85
|
+
when :datetime : 'date'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# note, we dont vals[:foo] = foo because dont want to bother generating key if its same as jqGrid default
|
90
|
+
def jqgrid_properties
|
91
|
+
vals = {
|
92
|
+
:name => name,
|
93
|
+
:index => name
|
94
|
+
}
|
95
|
+
#xmlmap not required when same as :name
|
96
|
+
# vals[:xmlmap] = name if data_type == :xml
|
97
|
+
# vals[:jsonmap] = name if data_type == :json
|
98
|
+
|
99
|
+
vals[:label] = label || name.titleize
|
100
|
+
vals[:resizable] = false if resizable==false
|
101
|
+
vals[:fixed] = fixed_width unless fixed_width==false
|
102
|
+
vals[:sortable] = false if sortable==false
|
103
|
+
vals[:sort_type] = jqgrid_type if sortable
|
104
|
+
vals[:search] = false if searchable==false
|
105
|
+
vals[:editable] = true if editable
|
106
|
+
vals[:align] = align if align
|
107
|
+
#vals[:align] = 'right' if [:integer, :float, :currency].include?(value_type)
|
108
|
+
case value_type
|
109
|
+
when :datetime
|
110
|
+
vals[:formatter] = 'date'
|
111
|
+
vals[:formatoptions] = { :srcformat => 'UniversalSortableDateTime', :newformat => 'FullDateTime' }
|
112
|
+
end
|
113
|
+
vals[:hidden] = true if hidden
|
114
|
+
vals[:width] = width if width
|
115
|
+
vals[:formatter] = formatter if formatter
|
116
|
+
vals[:formatoptions] = format_options if format_options
|
117
|
+
vals[:edittype] = edit_type if editable && edit_type
|
118
|
+
vals[:formoptions] = form_options if editable && form_options
|
119
|
+
vals[:editoptions] = edit_options if editable && edit_options
|
120
|
+
vals[:editrules] = validations if editable && validations
|
121
|
+
|
122
|
+
vals[:sort_type] = sort_type if sort_type
|
123
|
+
vals[:summaryType] = summary_type if summary_type
|
124
|
+
vals[:summaryTpl] = summary_tpl if summary_tpl
|
125
|
+
# and more...
|
126
|
+
|
127
|
+
vals
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
#<ActiveRecord::ConnectionAdapters::SQLiteColumn:0x2515a98 @sql_type="varchar(255)", @name="title", @precision=nil, @primary=false, @default=nil, @limit=255, @null=true, @type=:string, @scale=nil>
|
134
|
+
|
@@ -0,0 +1,223 @@
|
|
1
|
+
module Gridify
|
2
|
+
class Grid
|
3
|
+
|
4
|
+
attr_accessor :search_rules, # current search/filter rules, as hash
|
5
|
+
:search_rules_op # :and, :or
|
6
|
+
|
7
|
+
# finds records based on request params
|
8
|
+
# e.g. params from jqGrid
|
9
|
+
# :_search do search (true/false) ["false"]
|
10
|
+
# :sidx sort index (column to search on) [""]
|
11
|
+
# :sord sort direction (desc/asc) ["asc"]
|
12
|
+
# :nd ?
|
13
|
+
# :rows number of items to get ["20"]
|
14
|
+
# :page page number (starts at 1) ["1"]
|
15
|
+
|
16
|
+
def update_from_params( params )
|
17
|
+
params.symbolize_keys!
|
18
|
+
params_to_rules params
|
19
|
+
self.data_type = params[:datatype] if params[:datatype]
|
20
|
+
self.sort_by = params[:sidx] if params[:sidx]
|
21
|
+
self.sort_order = params[:sord] if params[:sord]
|
22
|
+
self.current_page = params[:page].to_i if params[:page]
|
23
|
+
self.rows_per_page = params[:rows].to_i if params[:rows]
|
24
|
+
self.total_rows = params[:total_rows].to_i if params[:total_rows]
|
25
|
+
end
|
26
|
+
|
27
|
+
# return find args (scope) for current settings
|
28
|
+
def current_scope
|
29
|
+
#debugger
|
30
|
+
find_args = {}
|
31
|
+
find_args[:include] = colInclude if colInclude
|
32
|
+
if sort_by.present? && col = columns_hash[sort_by]
|
33
|
+
if (sort_by.include? ".")
|
34
|
+
# Workaround for :include and nested attributes
|
35
|
+
field = sort_by.split('.', 2)
|
36
|
+
if field.length == 2
|
37
|
+
self.sort_by = field[0].pluralize + "." + field[1]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
if case_sensitive || !([:string, :text].include?(col.value_type))
|
41
|
+
find_args[:order] = "#{sort_by} #{sort_order}"
|
42
|
+
else
|
43
|
+
find_args[:order] = "upper(#{sort_by}) #{sort_order}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
if total_rows.present? && total_rows > 0
|
47
|
+
find_args[:limit] = total_rows
|
48
|
+
offset = (current_page.to_i-1) * rows_per_page if current_page.present?
|
49
|
+
find_args[:offset] = offset if offset && offset > 0
|
50
|
+
elsif rows_per_page.present? && rows_per_page > 0
|
51
|
+
find_args[:limit] = rows_per_page
|
52
|
+
offset = (current_page.to_i-1) * rows_per_page if current_page.present?
|
53
|
+
find_args[:offset] = offset if offset && offset > 0
|
54
|
+
end
|
55
|
+
cond = rules_to_conditions
|
56
|
+
find_args[:conditions] = cond unless cond.blank?
|
57
|
+
find_args
|
58
|
+
end
|
59
|
+
|
60
|
+
def find( params )
|
61
|
+
#debugger
|
62
|
+
update_from_params params
|
63
|
+
klass = resource.classify.constantize
|
64
|
+
records = klass.send( finder, :all, current_scope )
|
65
|
+
end
|
66
|
+
|
67
|
+
def encode_records( records, userdata=nil, total_count=nil )
|
68
|
+
#debugger
|
69
|
+
klass = resource.classify.constantize
|
70
|
+
total_count ||= klass.count
|
71
|
+
total_pages = total_count / rows_per_page + 1
|
72
|
+
#TODO: :only => [attributes], :methods => [virtual attributes]
|
73
|
+
case data_type
|
74
|
+
when :xml
|
75
|
+
if colInclude
|
76
|
+
xml = records.to_xml( :include => colInclude, :skip_types => true, :dasherize => false ) do |xml|
|
77
|
+
if rows_per_page > 0
|
78
|
+
xml.page current_page
|
79
|
+
xml.total total_pages
|
80
|
+
xml.records total_count
|
81
|
+
end
|
82
|
+
end
|
83
|
+
else
|
84
|
+
xml = records.to_xml( :skip_types => true, :dasherize => false ) do |xml|
|
85
|
+
if rows_per_page > 0
|
86
|
+
xml.page current_page
|
87
|
+
xml.total total_pages
|
88
|
+
xml.records total_count
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
when :json
|
93
|
+
#debugger
|
94
|
+
data = { resource => records }
|
95
|
+
if rows_per_page > 0
|
96
|
+
data.merge!(
|
97
|
+
:page => current_page,
|
98
|
+
:total => total_pages,
|
99
|
+
:records => total_count
|
100
|
+
)
|
101
|
+
end
|
102
|
+
data.merge!( :userdata => userdata ) if userdata
|
103
|
+
save = ActiveRecord::Base.include_root_in_json
|
104
|
+
ActiveRecord::Base.include_root_in_json = false
|
105
|
+
if colInclude
|
106
|
+
json = data.to_json(:include => colInclude)
|
107
|
+
else
|
108
|
+
json = data.to_json
|
109
|
+
end
|
110
|
+
ActiveRecord::Base.include_root_in_json = save
|
111
|
+
json
|
112
|
+
#others...
|
113
|
+
else #nop ?
|
114
|
+
records.to_s
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def find_and_encode( params )
|
119
|
+
encode_records( find( params ) )
|
120
|
+
end
|
121
|
+
|
122
|
+
# grid doesnt nest attributes inside the resource
|
123
|
+
# could change this behavior in jqGrid, see grid.postext.js ?
|
124
|
+
# http://www.trirand.com/jqgridwiki/doku.php?id=wiki:post_data_module
|
125
|
+
#
|
126
|
+
def member_params( params )
|
127
|
+
params.inject({}) {|h, (name, value)| h[name] = value if columns_hash[name]; h }
|
128
|
+
end
|
129
|
+
|
130
|
+
protected
|
131
|
+
|
132
|
+
OPS = { 'eq' => '=', 'lt' => '<', 'le' => '<=', 'gt' => '>', 'ge' => '>=', 'ne' => '!=' }
|
133
|
+
#['eq','ne','lt','le','gt','ge',
|
134
|
+
# 'bw','bn','in','ni','ew','en','cn','nc']
|
135
|
+
#['equal','not equal', 'less', 'less or equal','greater','greater or equal',
|
136
|
+
# 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain']
|
137
|
+
|
138
|
+
OPS_PATTERN = {
|
139
|
+
'bw' => '?%',
|
140
|
+
'bn' => '?%',
|
141
|
+
# 'in'
|
142
|
+
# 'ni'
|
143
|
+
'ew' => '%?',
|
144
|
+
'en' => '%?',
|
145
|
+
'cn' => '%?%',
|
146
|
+
'nc' => '%?%',
|
147
|
+
}
|
148
|
+
|
149
|
+
STRING_OPS = {
|
150
|
+
'bw' => 'LIKE',
|
151
|
+
'bn' => 'NOT LIKE',
|
152
|
+
'ew' => 'LIKE',
|
153
|
+
'en' => 'NOT LIKE',
|
154
|
+
'cn' => 'LIKE',
|
155
|
+
'nc' => 'NOT LIKE',
|
156
|
+
}
|
157
|
+
|
158
|
+
# params[:filters] => {"groupOp"=>"AND",
|
159
|
+
# "rules"=>[{"data"=>"b", "op"=>"ge", "field"=>"title"}, {"data"=>"f", "op"=>"le", "field"=>"title"}] }
|
160
|
+
def params_to_rules( params )
|
161
|
+
#debugger
|
162
|
+
if params[:_search]=='true' || params[:_search]==true
|
163
|
+
if params[:filters]
|
164
|
+
# advanced search
|
165
|
+
filters = ActiveSupport::JSON.decode( params[:filters] )
|
166
|
+
self.search_rules = filters['rules']
|
167
|
+
self.search_rules_op = filters['groupOp']
|
168
|
+
elsif params[:searchField]
|
169
|
+
# simple search
|
170
|
+
self.search_rules = [{ "field" => params[:searchField], "op" => params[:searchOper], "data" => params[:searchString]}]
|
171
|
+
else
|
172
|
+
# toolbar search
|
173
|
+
self.search_rules = []
|
174
|
+
self.search_rules_op = :and
|
175
|
+
colModel.each do |col|
|
176
|
+
name = col.name
|
177
|
+
data = params[name.to_sym]
|
178
|
+
self.search_rules << { "field" => name, "op" => "cn", "data" => data } if data
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
search_rules
|
183
|
+
end
|
184
|
+
|
185
|
+
def rules_to_conditions
|
186
|
+
# note: ignoring case_sensitive as an option, ActiveRecord find is insensitive by default (have to model the db to let it be case sensitive?)
|
187
|
+
return nil if search_rules.blank?
|
188
|
+
cond = nil
|
189
|
+
expr = ''
|
190
|
+
vals = []
|
191
|
+
search_rules.each do |rule|
|
192
|
+
|
193
|
+
# Workaround for :include and nested attributes
|
194
|
+
field = rule['field'].split('.', 2)
|
195
|
+
if field.length == 2
|
196
|
+
rule['field'] = field[0].pluralize + "." + field[1]
|
197
|
+
end
|
198
|
+
|
199
|
+
expr << " #{search_rules_op} " unless expr.blank?
|
200
|
+
if op = OPS[rule['op']]
|
201
|
+
expr << "#{rule['field']} #{op} ?"
|
202
|
+
vals << rule['data']
|
203
|
+
elsif op = STRING_OPS[rule['op']]
|
204
|
+
expr << "#{rule['field']} #{op} ?"
|
205
|
+
vals << OPS_PATTERN[rule['op']].gsub('?', rule['data'])
|
206
|
+
end
|
207
|
+
end
|
208
|
+
cond = [ expr ] + vals
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# # If you need to display error messages
|
214
|
+
# err = ""
|
215
|
+
# if user
|
216
|
+
# user.errors.entries.each do |error|
|
217
|
+
# err << "<strong>#{error[0]}</strong> : #{error[1]}<br/>"
|
218
|
+
# end
|
219
|
+
# end
|
220
|
+
#
|
221
|
+
# render :text => "#{err}"
|
222
|
+
|
223
|
+
# { :add => true, :edit => true, :inline_edit => false, :delete => true, :edit_url => "/users/post_data", :error_handler => "after_submit" }
|
@@ -0,0 +1,279 @@
|
|
1
|
+
module Gridify
|
2
|
+
class Grid
|
3
|
+
# non persistent options:
|
4
|
+
# :build_model
|
5
|
+
# :only
|
6
|
+
# :except
|
7
|
+
|
8
|
+
attr_accessor :name, # name of the table (required)
|
9
|
+
:resource, # based on AR model class (assume tableized, plural, string)
|
10
|
+
# used as basis for all RESTful requests and data format
|
11
|
+
# model
|
12
|
+
:colModel, # incoming: hash of presets (native jqGrid); internally: array of GridColumn objects
|
13
|
+
# { :body => { "title" => {"width" => 98} }}
|
14
|
+
:colNames, # Column names
|
15
|
+
:colInclude, # included submodels
|
16
|
+
#:widths, # hash of column width (key = data type)
|
17
|
+
:searchable, # default: true (used in generating columns, changing has no effect on existing cols)
|
18
|
+
:sortable, # default: true (used in generating columns, changing has no effect on existing cols)
|
19
|
+
:editable, # default: false (used in generating columns, changing has no effect on existing cols)
|
20
|
+
:inline_edit,
|
21
|
+
:inline_edit_handler,
|
22
|
+
# grid
|
23
|
+
:dom_id, # defaults to #{resource}_#{name} eg "notes_grid"
|
24
|
+
:grid_view,
|
25
|
+
:jqgrid_options, # hash of additional jqGrid options that override any other settings
|
26
|
+
:ajax_grid_options,
|
27
|
+
#subgrid
|
28
|
+
:sub_grid,
|
29
|
+
:sub_grid_url,
|
30
|
+
:sub_grid_model,
|
31
|
+
# grid layout options
|
32
|
+
:width, # in pixels, or nil (nil means calculated based on overflow setting)
|
33
|
+
:width_fit, # :fluid, :scroll, or :visible
|
34
|
+
# :fluid will always fit container (presently ignores width option)
|
35
|
+
# :scroll uses horizontal scrollbars
|
36
|
+
# :fitted scales columns to fit in width, not fluid
|
37
|
+
:height, # in pixels, '100%', or :auto (150)
|
38
|
+
# :auto means makes it as tall as needed per number of rows
|
39
|
+
:resizable, # allow gride resize with mouse, (true) (or {}) for default options;
|
40
|
+
# nil or false for disabled; or hash of jqUI options
|
41
|
+
# see http://jqueryui.com/demos/resizable/
|
42
|
+
# defaults (differ from jqUI ones) "minWidth" => 150, "minHeight" => 80
|
43
|
+
# when overflow is fluid, "handles" => 's', otherwise 'e, s, se'
|
44
|
+
:arranger, # :sortable, :hide_show, :chooser, or nil for none (nil) ,
|
45
|
+
# can combine with array of options
|
46
|
+
# or can be a hash with options
|
47
|
+
# see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:show_hide_columns
|
48
|
+
# rows
|
49
|
+
:alt_rows, # true for odd/even row classes, or odd row style name string (nil)
|
50
|
+
:row_numbers, # true to display row numbers in left column; or numeric width in pixels (nil)
|
51
|
+
:select_rows, # true for rows are selectable (eg for pager buttons); or js function when row is selected, false disables hover (true if pager buttons else false)
|
52
|
+
:multi_select,
|
53
|
+
:sortable_rows,
|
54
|
+
# header layer
|
55
|
+
:title, # title string (aka caption), or true for resource.titleize, nil for no title (nil)
|
56
|
+
:collapsible, # when true generates collapse icon (false)
|
57
|
+
:collapsed, # when true initial state is collapsed (false)
|
58
|
+
|
59
|
+
# pager layer
|
60
|
+
:pager, # id of the pager, or true => dom_id+"_pager", false or nil for no pager (nil)
|
61
|
+
:paging_controls, # false to disable all (true); or hash with native jqGrid options
|
62
|
+
:paging_choices, # array of rows_per_page choices ([10,25,50,100])
|
63
|
+
# nav buttons
|
64
|
+
:view_button, # true, or hash of native jqGrid parameters and events for the action
|
65
|
+
:add_button,
|
66
|
+
:edit_button,
|
67
|
+
:delete_button,
|
68
|
+
:search_button, # enable search button and dialog
|
69
|
+
:search_advanced, # instead of search_button
|
70
|
+
:search_toolbar, # toggleable search bar, true or :visible, :hidden (other options?) (nil)
|
71
|
+
:refresh_button,
|
72
|
+
:jqgrid_nav_options, # native jqGrid button options (added to 2nd arg in navGrid method)
|
73
|
+
# data
|
74
|
+
:restful, # use restful url and mtype (true) for all actions
|
75
|
+
:finder, # default: :find
|
76
|
+
:url, # request url (required unless table_to_grid or derived from resource)
|
77
|
+
# if nil, uses "/#{resource}" eg "/notes"
|
78
|
+
# note, to force "editurl" use jqgrid_options
|
79
|
+
|
80
|
+
:data_type, # :xml, :json, and other defined in jqGrid options doc (xml)
|
81
|
+
:data_format, # (defaults to rails conventin based on resource) <chickens><chicken><title><body> format
|
82
|
+
# set false for jqGrid default <rows><records><row><cell> format
|
83
|
+
:sort_by, # name of sort column of next request
|
84
|
+
:sort_order, # sort direction of next request, 'asc' or 'desc' ('asc')
|
85
|
+
:case_sensitive, # sort and search are case sensitive (false)
|
86
|
+
:current_page, # current page requested
|
87
|
+
:rows_per_page, # number of items to be requested in the next request (paging_choices.first or -1 if pager false)
|
88
|
+
:total_rows, # number of rows to read
|
89
|
+
:table_to_grid, # when true generates tableToGrid (false) from html table, then use as local data
|
90
|
+
# note, we assume table rows are not selectable.
|
91
|
+
# (tableToGrid sets multiselect when first col has checkboxes or radio buttons,
|
92
|
+
# we dont know to preserve this so you also need to set in options)
|
93
|
+
:load_once, # true to use local data after first load (false)
|
94
|
+
:error_handler, # javacript: method for crud error handling (default to "after_submit")
|
95
|
+
:error_container, # selector for posting error/flash messages (.errorExplanation)
|
96
|
+
# events
|
97
|
+
#:on_dbl_click_row,
|
98
|
+
#:on_sort_col,
|
99
|
+
#:serialize_grid_data,
|
100
|
+
|
101
|
+
:z
|
102
|
+
|
103
|
+
# ----------------------
|
104
|
+
# attribute defaults and special value handling
|
105
|
+
# (sure it'd be easier to initialize defaults using a hash but we want nil to mean the jqGrid default - might be true - and not pass a value at all)
|
106
|
+
|
107
|
+
def inline_edit
|
108
|
+
@inline_edit==true ? true : false
|
109
|
+
end
|
110
|
+
|
111
|
+
def inline_edit_handler
|
112
|
+
@inline_edit_handler || 'null'
|
113
|
+
end
|
114
|
+
|
115
|
+
def finder
|
116
|
+
@finder || :find
|
117
|
+
end
|
118
|
+
|
119
|
+
def searchable
|
120
|
+
@searchable==false ? false : true
|
121
|
+
end
|
122
|
+
|
123
|
+
def sortable
|
124
|
+
@sortable==false ? false : true
|
125
|
+
end
|
126
|
+
|
127
|
+
def sortable_rows
|
128
|
+
@sortable_rows==true ? true : false
|
129
|
+
end
|
130
|
+
|
131
|
+
def dom_id
|
132
|
+
@dom_id || "#{resource}_#{name}"
|
133
|
+
end
|
134
|
+
|
135
|
+
def grid_view
|
136
|
+
@grid_view==false ? false : true
|
137
|
+
end
|
138
|
+
|
139
|
+
def jqgrid_options
|
140
|
+
@jqgrid_options || {}
|
141
|
+
end
|
142
|
+
|
143
|
+
def ajax_grid_options
|
144
|
+
@ajax_grid_options || {}
|
145
|
+
end
|
146
|
+
|
147
|
+
def width_fit
|
148
|
+
@width_fit || :fluid
|
149
|
+
end
|
150
|
+
|
151
|
+
def resizable
|
152
|
+
return false if @resizable == false
|
153
|
+
rs = { "minWidth" => 150, "minHeight" => 80 }
|
154
|
+
rs.merge!({ "handles" => 's' }) if width_fit == :fluid
|
155
|
+
rs.merge!( @resizable ) if @resizable.is_a?(Hash)
|
156
|
+
rs
|
157
|
+
end
|
158
|
+
|
159
|
+
def arranger_type #read-only
|
160
|
+
if arranger.is_a?(Hash)
|
161
|
+
arranger.keys
|
162
|
+
else
|
163
|
+
Array(arranger)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
def arranger_options(type) #read-only
|
168
|
+
(arranger[type] if arranger.is_a?(Hash)) || {}
|
169
|
+
end
|
170
|
+
|
171
|
+
def select_rows
|
172
|
+
if @select_rows
|
173
|
+
@select_rows
|
174
|
+
else
|
175
|
+
pager && (view_button || edit_button || delete_button)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# header layer
|
180
|
+
def title
|
181
|
+
case @title
|
182
|
+
when String: @title
|
183
|
+
when true: resource.titleize
|
184
|
+
else
|
185
|
+
(' ' if collapsible || collapsed) #show header with blank title
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
def collapsible
|
190
|
+
@collapsible || @collapsed
|
191
|
+
end
|
192
|
+
|
193
|
+
# pager layer
|
194
|
+
def pager
|
195
|
+
case @pager
|
196
|
+
when String: @pager
|
197
|
+
when true: dom_id+'_pager'
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
def paging_controls
|
202
|
+
@paging_controls.nil? ? true : @paging_controls
|
203
|
+
end
|
204
|
+
|
205
|
+
def paging_choices
|
206
|
+
@paging_choices || [10,25,50,100]
|
207
|
+
end
|
208
|
+
|
209
|
+
def restful
|
210
|
+
@restful==false ? false : true
|
211
|
+
end
|
212
|
+
|
213
|
+
# data
|
214
|
+
def url
|
215
|
+
@url || "/#{resource}"
|
216
|
+
end
|
217
|
+
|
218
|
+
def rows_per_page
|
219
|
+
#debugger
|
220
|
+
# all rows when pager controls or rows per page are off
|
221
|
+
if !pager || paging_controls==false || @rows_per_page==false || @rows_per_page==-1
|
222
|
+
-1
|
223
|
+
elsif @rows_per_page.nil?
|
224
|
+
paging_choices.first
|
225
|
+
else
|
226
|
+
@rows_per_page
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
def data_type
|
231
|
+
@data_type || :json
|
232
|
+
end
|
233
|
+
|
234
|
+
def data_format
|
235
|
+
if @data_format || @data_format==false #explicit false for no param
|
236
|
+
@data_format
|
237
|
+
elsif resource && data_type == :xml
|
238
|
+
{
|
239
|
+
:root => resource,
|
240
|
+
:page => resource+'>page',
|
241
|
+
:total => resource+'>total',
|
242
|
+
:records => resource+'>records',
|
243
|
+
:row => resource.singularize,
|
244
|
+
:repeatitems => false,
|
245
|
+
:id => :id
|
246
|
+
}
|
247
|
+
elsif resource && data_type == :json
|
248
|
+
{
|
249
|
+
:root => resource,
|
250
|
+
:page => 'page',
|
251
|
+
:total => 'total',
|
252
|
+
:records => 'records',
|
253
|
+
:row => resource.singularize,
|
254
|
+
:repeatitems => false,
|
255
|
+
:id => :id
|
256
|
+
}
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
# events
|
261
|
+
|
262
|
+
# def serialize_grid_data
|
263
|
+
# @serialize_grid_data || {}
|
264
|
+
# end
|
265
|
+
|
266
|
+
def error_handler
|
267
|
+
@error_handler || 'gridify_action_error_handler'
|
268
|
+
end
|
269
|
+
|
270
|
+
def error_handler_return_value
|
271
|
+
error_handler ? error_handler : 'true;'
|
272
|
+
end
|
273
|
+
|
274
|
+
def error_container
|
275
|
+
@error_container || '.errorExplanation'
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
279
|
+
end
|