lib/netzke/tree_panel.rb in netzke-basepack-0.4.2 vs lib/netzke/tree_panel.rb in netzke-basepack-0.5.1
- old
+ new
@@ -1,53 +1,52 @@
class Netzke::TreePanel < Netzke::Base
- interface :get_children
+ api :get_children
def self.js_base_class
"Ext.tree.TreePanel"
end
- def self.js_default_config
+ def self.js_common_config_for_constructor
super.merge({
:root => {:text => '/', :id => 'source'},
- :loader => {:data_url => "config.interface.getChildren".l}
+ :loader => {:data_url => "config.api.getChildren".l}
})
end
def self.js_extend_properties
{
- :on_widget_load => <<-JS.l,
+ :refresh_handler => <<-END_OF_JAVASCRIPT.l,
function(){
- }
- JS
- :refresh_handler => <<-JS.l,
- function(){
console.info('refresh!');
}
- JS
- :add_handler => <<-JS.l,
+ END_OF_JAVASCRIPT
+
+ :add_handler => <<-END_OF_JAVASCRIPT.l,
function(e){
console.info(e);
}
- JS
- :edit_handler => <<-JS.l,
+ END_OF_JAVASCRIPT
+
+ :edit_handler => <<-END_OF_JAVASCRIPT.l,
function(e){
console.info(e);
}
- JS
- :delete_handler => <<-JS.l
+ END_OF_JAVASCRIPT
+
+ :delete_handler => <<-END_OF_JAVASCRIPT.l
function(e){
console.info(e);
}
- JS
+ END_OF_JAVASCRIPT
}
end
def actions
{ :add => {:text => 'Add'},
:edit => {:text => 'Edit'},
- :delete => {:text => 'Delete', :disabled => true}
+ :del => {:text => 'Delete', :disabled => true}
}
end
def bbar
persistent_config[:bbar] ||= config[:bbar] == false ? nil : config[:bbar] || %w{ add edit delete }
\ No newline at end of file