PDA

View Full Version : Help regarding Ext.History



sam_ware
12 Jun 2009, 3:48 AM
Hello all,
I am kinda novice to EXT-JS . I was just trying to use Ext.History (http://extjs.com/deploy/ext-3.0-rc2/docs/source/History.html#cls-Ext.History) in my application . As per signature I wrote the constructure of History as follows


Ext.History.on('change',function(){

alert("Making the AJAX call with the datasource id is "+requestParams.dataSourceId);

});

and it worked fine for me. However when I try to do something like following

Ext.History.on('change',testMe())

function testMe(){
alert("Making the AJAX call with the datasource id is "+requestParams.dataSourceId);
}

I started getting javascript errors. Can anybody out here please explain me what is the cause of same ? If second parameter accept the function as parameter , then why can't I write my function seperately ? Or is there any other way /syntax to acheieve this ?
Thanks in advance
Samir