Sha256: 52f07707239d2bdada49867667aafd9e3901526e31766380c0a65c38d6d8f074
Contents?: true
Size: 1.18 KB
Versions: 24
Compression:
Stored size: 1.18 KB
Contents
module Netzke module Basepack # Include this module into your component component class when you want lazy-loaded component in config to be auto-replaced with # a panel with the 'fit' layout, and a property wrappedComponent set to the name of the original component. # Used, for instance, in TabPanel and Accordion to dynamically load components on expanding a panel or clicking # a tab. module WrapLazyLoaded def js_configure(cfg) super cfg.items = cfg.items.each_with_index.map do |item,i| c = components[item[:netzke_component]].try(:merge, item) # when a nested component with lazy loading is detected, it gets replaced with a 'fit' panel, # into which later the component itself is dynamically loaded on request. if c && !c[:eager_loading] && i != config.active_tab.to_i # so it works for both TabPanel and Accordion { layout: :fit, wrapped_component: c[:item_id], title: c[:title] || c[:item_id].humanize, icon_cls: c[:icon_cls], disabled: c[:disabled] } else item end end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems