in my app ,i want to create some function like extjs4 api,when i click the left tree menu, the content will show in the right.some code list below: left tree menu code:
var tree_panel = Ext.create('Ext.tree.Panel', {
listeners: {
'itemclick': function( grid, record, item, index, e, eOpts) {
Ext.Ajax.request({
url: 'code/list.js',
success: function(response){
show_tip_message("success!")
},
failure: function(response){
show_tip_message("false!")
}
});
}
}
codecontroller code(codecontroller.rb)
def list
respond_to do |format|
format.js
end
end
codeview code(list.js.erb)
var m_work_space = Ext.getCmp('work-space');
m_work_space.removeAll();
m_work_space.add(m_codegrid);
m_work_space.doLayout();
however when i click the tree item, it pop out notice success ,but the work-space doesn't refresh ,why? any help will appreciate