Created
April 30, 2014 11:03
-
-
Save t-oginogin/11423899 to your computer and use it in GitHub Desktop.
ThinReportsのリストでページ内にあと何行追加できるか調べたい ref: http://qiita.com/t_oginogin/items/f510d5d2fcd331e0c0ee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ThinReports | |
| module Core::Shape | |
| class List::Page < Basic::Interface | |
| def rest_row_count | |
| height = manager.current_page_state.height | |
| row_height = manager.current_page_state.format.section_height(:detail) | |
| max_height = manager.page_max_height | |
| row_count = (height / row_height).floor | |
| max_row_count = (max_height / row_height).floor | |
| max_row_count - row_count | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
これ欲かった機能です。
インストールされた gem の中の page.rb にこの処理を追加したところ動作良好です。
ですがこの方法だと thinkreports のバージョンアップに追随できません。
ローカルの環境にこの処理だけを入れるにはどのようにしたら良いのでしょうか?
いろいろやってみましたが私の知識では解決できませんでした。