Sha256: 7ca5aaa0125df2f185f4c5288150976fc19945bd8ae7e7d19f68ce8239d59ffe
Contents?: true
Size: 963 Bytes
Versions: 20
Compression:
Stored size: 963 Bytes
Contents
## # ExtJS::Helpers::Component # module ExtJS::Helpers module Component ## # add class-var @@extjs_on_ready def self.included(helper) end def extjs_component(*params) options = params.extract_options! options[:controller] = self ExtJS::Component.new(options) end ## # Adds a script or ExtJS::Component instance to on_ready queue. The queue is emptied and rendered to # <script></script> via #extjs_render # def extjs_onready(*params) @onready_queue = [] if @onready_queue.nil? params.each do |cmp| @onready_queue << cmp end end ## # Empties the on_ready queue. Renders within <script></script> tags # def extjs_render @onready_queue = [] if @onready_queue.nil? "<script>\nExt.onReady(function() {\n\t#{@onready_queue.collect {|cmp| (cmp.kind_of?(ExtJS::Component)) ? cmp.render : cmp}.join("\n\t")}\n });\n</script>" end end end
Version data entries
20 entries across 20 versions & 1 rubygems