I've been converting my entire project to use Ext.Direct over the last couple of days. I must say I really love the Direct implementation; however, sometimes the documentation is a bit sparse relating to additional parameters. So I wanted to post a few examples that aren't displayed in the ExtJS Samples section. The first example is how to load a remote combo w/ base params and the second is how to load a tree with direct, applying the baseParams before the request is made.

Hopefully someone will find these examples useful.


PHP Code:
/* Loading a combobox using Direct and baseParams */
{    
    
id'cboId',
    
xtype'combo',        
    
displayField'state',            
    
mode'remote',
    
triggerAction'all',                
    
emptyText:'Please Select...',
    
selectOnFocus:true,
    
width:235,
    
editablefalse,
    
displayField'BNK_nm',
    
valueField'BNK_id',
    
scopethis,                    
    
store: new Ext.data.DirectStore({    
        
directFnPnP2.TestBank.getTestBanks,                
        
totalProperty'total',
        
root'data',
        
id'BNK_id',
        
autoLoadtrue,    
        
fields: ['BNK_id''BNK_nm'],    
        
paramOrder: ['CLS_id'],                            
        
baseParams: {
            
CLS_idPnP.config.classId
        
}        
    })
}

/* Async tree loader with additional baseParams */
loader: new Ext.tree.TreeLoader({
    
directFnPnP2.Menu.getTree,
    
scopethis,
    
paramsAsHashtrue,
    
listeners: {
        
beforeload: function(treeLoadernode) {
             
this.baseParams = {
                   
type: (node.attributes.type) ? node.attributes.type 'root',
                   
codenode.attributes.code,
                   
clsnode.attributes.cls,
                   
clsstartnode.attributes.clsstart,
                   
clsendnode.attributes.clsend
             
};                            
        }
    }
})

/* PHP handler signature for tree loader */
public function getTree($args) {
    echo 
$args->type;            // Access the params / base params

Milan Zdimal