View Full Version : How do I call?

23 Mar 2011, 6:56 PM
I have following code.

In jsEntryTimesheet.js

var x = new Ext.form.FormPanel({

Ext.reg("jsEntryTimesheet", x);

And in jsTimeAndExpenses.js

btnTimesheet = new Ext.Button({
text: 'Timesheet',
flex: 1,
handler: function () {
// need to call "x of jsEntryTimesheet"



How do I call x object which is in "jsEntryTimesheet.js", when I click on "Timesheet" button?

24 Mar 2011, 4:02 AM
Mods need to move this into the Help forum.

Is the Buttons a child of the FormPanel?

14 Sep 2011, 12:41 AM
Hi Riaz,

if you want to access this button from a function I'd do it this way:

var panel = new Ext.form.formPanel({ });
[nameOfYouApp].views.formPanel = panel;

And you can call it this way:

handler : function() {
var formPanel = [nameOfYourApp].views.formPanel;

That's all