PDA

View Full Version : Load Items through Ajax



printscreen
7 Apr 2010, 2:14 PM
Is it possible to load object members dynamically via ajax? I have made it work using eval(), but id rather steer away from using eval if possible.

Heres what i have



region: 'west',
id: 'west-panel',
title: '',
width: 220,
autoHeight: true,
collapsible: true,
hideCollapseToole: false,
margins: '0 0 0 5',
onHide:function(){updateSize();},
renderHidden: true,
items: [{
items:[{
xtype: 'treepanel',
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: [{
text: 'Activate Subscriber',
leaf: true
}, {
text: 'Suspend Subscriber',
leaf: true
}, {
text: 'Change Sim',
leaf: true
}, {
text: 'Restore Subscriber',
leaf: true
}]
}),
rootVisible: false,
listeners: {
click: function(n) {
//TODO - MAKE CALL TO URL TO LOAD EXTJS DEPENDING ON MENU SELECTION
// LOAD THE VIEWPORT CODE FROM URL INTO 'center' section of this viewport
viewport.doLayout();
}
}


Calling back to this URL to load a remote viewport allows me greater control of ACL and you what i let the user load onto thier screen. This allows me to hide to many users that this option/tool even exists, even though they wouldnt be able to make that ajax call anyways.