62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/netzke/basepack/query_builder.rb', line 62
def js_config
super.tap do |s|
s[:bbar] = (config[:bbar] || []) + [:clear_all.action, :reset.action, "->",
I18n.t('netzke.basepack.query_builder.presets'),
{
:itemId => "presetsCombo",
:xtype => "combo",
:triggerAction => "all",
:value => super[:load_last_preset] && last_preset.try(:fetch, "name"),
:store => state[:presets].blank? ? [[[], ""]] : state[:presets].map{ |s| [s["query"], s["name"]] },
:ref => "../presetsCombo",
:listeners => {:before_select => {
:fn => "function(combo, record){
var form = Ext.getCmp('#{global_id}');
form.buildFormFromQuery(record.data.field1);
}".l
}}
}, :save_preset.action, :delete_preset.action
]
end
end
|