Dynamic Method Handling

#method_missing(name, *args) ⇒ Object

classMyComponent<Netzke::Basejs_configuredo|c|# this will result in the +title+ property defined on the client class prototype
c.title="My cool component"# this will result in the +onButtonPress+ function defined on the client class prototype
c.on_button_press=<<-JS function(){
// ...
}
JS
endend

An alternative way to define prototype properties is by using “mixins”, see
#mixin

#class_alias ⇒ Object

#class_code ⇒ Object

Component's JavaScript class declaration. It gets stored in the JS
class cache storage (Netzke.classes) at the client side to be reused at the
moment of component instantiation.

161
162
163
164
165
166
167
168
169
170
171
172
173
174

# File 'lib/netzke/core/client_class.rb', line 161defclass_coderes=[]# Defining the scope if it isn't known yet
res<<%{Ext.ns("#{scope}");}unlessscope==default_scoperes<<class_declaration# Store created class xtype in the cache
res<<%(
Netzke.cache.push('#{xtype}');
)res.join("\n")end

#class_declaration ⇒ Object

Generates declaration of the JS class as direct extension of a Ext
component

#required ⇒ Object

Returns all required JavaScript files as a string

199
200
201
202
203
204
205
206
207
208
209
210
211

# File 'lib/netzke/core/client_class.rb', line 199defrequiredres=""# Prevent re-including code that was already required by the parent
# (thus, only require those JS files when require_js was defined in the current class, not in its ancestors)
# FIXME!
((@klass.singleton_methods(false).map(&:to_sym).include?(:include_js)?include_js:[])+required_files).eachdo|path|f=File.new(path)res<<f.read<<"\n"endresend

#scope ⇒ Object

Returns the scope of this component e.g. “Netzke.classes.Netzke.Basepack”