wice_grid 3.2.1.pre2 → 3.2.1.pre3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/helpers/wice_grid_view_helpers.rb +30 -8
- data/lib/wice_grid.rb +18 -22
- data/wice_grid.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.1.
|
1
|
+
3.2.1.pre3
|
@@ -461,14 +461,14 @@ module Wice
|
|
461
461
|
grid.output_buffer << '</div>'
|
462
462
|
|
463
463
|
if Rails.env == 'development'
|
464
|
-
grid.output_buffer << javascript_tag(%/
|
464
|
+
grid.output_buffer << javascript_tag(%/ window.onload = function(){ \n/ +
|
465
465
|
%$ if (typeof(WiceGridProcessor) == "undefined"){\n$ +
|
466
466
|
%$ alert("wice_grid.js not loaded, WiceGrid cannot proceed!\\n" +\n$ +
|
467
467
|
%$ "Make sure that you have loaded wice_grid.js.\\n" +\n$ +
|
468
468
|
%$ "Add line\\n//= require wice_grid.js\\n" +\n$ +
|
469
469
|
%$ "to app/assets/javascripts/application.js")\n$ +
|
470
470
|
%$ }\n$ +
|
471
|
-
%$ }
|
471
|
+
%$ } $)
|
472
472
|
end
|
473
473
|
|
474
474
|
grid.output_buffer
|
@@ -623,20 +623,42 @@ module Wice
|
|
623
623
|
|
624
624
|
collection = grid.resultset
|
625
625
|
|
626
|
-
|
626
|
+
if grid.all_record_mode?
|
627
|
+
|
628
|
+
collection_total_entries = collection.size
|
629
|
+
current_page = 1
|
630
|
+
per_page = collection_total_entries
|
631
|
+
|
632
|
+
first = 1
|
633
|
+
last = collection.size
|
634
|
+
|
635
|
+
num_pages = 1
|
636
|
+
|
637
|
+
class << collection
|
638
|
+
def current_page
|
639
|
+
1
|
640
|
+
end
|
627
641
|
|
642
|
+
def total_pages
|
643
|
+
1
|
644
|
+
end
|
645
|
+
end
|
628
646
|
|
629
|
-
|
630
|
-
|
647
|
+
else
|
648
|
+
collection_total_entries = collection.total_count
|
649
|
+
current_page = grid.ar_options[:page].to_i
|
650
|
+
per_page = grid.ar_options[:per_page].to_i
|
631
651
|
|
632
|
-
|
633
|
-
|
652
|
+
first = collection.offset_value + 1
|
653
|
+
last = collection.last_page? ? collection.total_count : collection.offset_value + collection.limit_value
|
634
654
|
|
655
|
+
num_pages = collection.num_pages
|
656
|
+
end
|
635
657
|
|
636
658
|
parameters = grid.get_state_as_parameter_value_pairs
|
637
659
|
|
638
660
|
js = ''
|
639
|
-
html = if (
|
661
|
+
html = if (num_pages < 2 && collection.length == 0)
|
640
662
|
'0'
|
641
663
|
else
|
642
664
|
parameters << ["#{grid.name}[pp]", collection_total_entries]
|
data/lib/wice_grid.rb
CHANGED
@@ -265,21 +265,16 @@ module Wice
|
|
265
265
|
@ar_options[:order] += ' ' + @status[:order_direction]
|
266
266
|
end
|
267
267
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
@status[:pp] = count_resultset_without_paging_without_user_filters
|
272
|
-
else
|
273
|
-
@status[:per_page]
|
274
|
-
end
|
268
|
+
@ar_options[:joins] = @options[:joins]
|
269
|
+
@ar_options[:include] = @options[:include]
|
270
|
+
@ar_options[:group] = @options[:group]
|
275
271
|
|
272
|
+
if self.output_html?
|
273
|
+
@ar_options[:per_page] = @status[:per_page]
|
276
274
|
@ar_options[:page] = @status[:page]
|
277
275
|
@ar_options[:total_entries] = @status[:total_entries] if @status[:total_entries]
|
278
276
|
end
|
279
277
|
|
280
|
-
@ar_options[:joins] = @options[:joins]
|
281
|
-
@ar_options[:include] = @options[:include]
|
282
|
-
@ar_options[:group] = @options[:group]
|
283
278
|
end
|
284
279
|
|
285
280
|
|
@@ -287,7 +282,7 @@ module Wice
|
|
287
282
|
def read #:nodoc:
|
288
283
|
form_ar_options
|
289
284
|
@klass.unscoped do
|
290
|
-
@resultset = if self.output_csv?
|
285
|
+
@resultset = if self.output_csv? || all_record_mode?
|
291
286
|
# @relation.find(:all, @ar_options)
|
292
287
|
@relation.
|
293
288
|
includes(@ar_options[:include]).
|
@@ -538,17 +533,18 @@ module Wice
|
|
538
533
|
end
|
539
534
|
end
|
540
535
|
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
end
|
536
|
+
# not used right now
|
537
|
+
# def count_resultset_without_paging_without_user_filters #:nodoc:
|
538
|
+
# form_ar_options
|
539
|
+
# @klass.unscoped do
|
540
|
+
# @relation.count(
|
541
|
+
# :joins => @ar_options[:joins],
|
542
|
+
# :include => @ar_options[:include],
|
543
|
+
# :group => @ar_options[:group],
|
544
|
+
# :conditions => @options[:conditions]
|
545
|
+
# )
|
546
|
+
# end
|
547
|
+
# end
|
552
548
|
|
553
549
|
|
554
550
|
def resultset_without_paging_with_user_filters #:nodoc:
|
data/wice_grid.gemspec
CHANGED