Skip to content

Instantly share code, notes, and snippets.

View mxgrn's full-sized avatar

Max Gorin mxgrn

View GitHub Profile
# Example of Netzke Helper
module Netzke::Helpers::GridPanelClerk
# which model's methods should be used as virtual column, along with configuration
def self.virtual_attributes
[:name]
end
# preconfigure some columns
def self.attributes_config
{
class Netzke::TreePanel < Netzke::Base
api :get_children
def self.js_base_class
"Ext.tree.TreePanel"
end
def self.js_extend_properties
{
:root => {:text => '/', :id => 'source'}
module Netzke
class TreeNavigator < BorderLayoutPanel
# BorderLayoutPanel's regions
def initial_aggregatees
{
:west => {
:widget_class_name => "TreePanel",
:data_class_name => config[:tree_data_class_name],
:region_config => {
/*
CheckColumn plugin from the "Editable Grid" example on http://extjs.com/deploy/dev/examples/
The problem with it is that when a new record is added to the store, the corresponding field value
is set to an empty string, instead of being set to false. Here's the fix for it.
*/
Ext.grid.CheckColumn = function(config){
Ext.apply(this, config);
if(!this.id){
this.id = Ext.id();
}