Sonn Sonn - 1 year ago 49
Javascript Question

ExtJS/Javascript: How the function for clicking event actually works?

sorry if my question sounds stupid but I would like to ask that how the function for clicking event actually works? I mean how the parameters are passed to the called function. For example in this ExtJS Example, in the View when we click the delete button, it will call the

onDelete
function which be defined in the Controller:

onDelete: function (t, rowid, colid, item, evt, rec) {
var store = rec.store;

store.remove(rec);
store.sync();
}


What i dont really understand here is how these parameters (t, rowid, colid, evt, rec) are passed to the function definition while in the view we called only the name of the function
onDelete
, nothing else. So where these parameters come from?

Any answer is appreciated and please dont vote my question down insted ignore it if you think it is a stupid one but i just ask what i really dont understand. Thank you

Answer Source

These parameter are passed by the ExtJS library. This allows you to concentrate on the feature you want to achieve (delete a record) instead of writing code to find the clicked row record before doing the real work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download