Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: open

Message Too Old, No Replies

A little help with javacsript class code.

     

nelsonm

8:38 pm on Jun 5, 2012 (gmt 0)

5+ Year Member



hi all,

I had a developer write a javascript component made up of a set of classes to create and manage a work order dispatch board (work order calendar). Unfortunately, the developer is no longer available (after being paid) and i'm having some trouble modifying his classes.

The problem is getting the dispatch board to refresh from the work order entry dialog. The class that contains the refresh methods is in one script and the work order entry dialog is in another.


The dispatch board class...

$.declare('window.dispatchBoard',{ 
.
.
constructor: function (arg) {
.
.
}
.
.
refresh: function() {]
.
.
}
.
.
});


I thought i could create a new instance of the class object this way...

dispatch = new window.dispatchBoard();


and call it from the work order entry dialog submit success function...

$('#workorder-window').dialog({ 
.
.
buttons: {
'submit' function() {
.
.
$.ajax({
.
.
success: function(status) {
dispatch.refresh();
}
});
}
.
.
});



But i'm getting the error "window.dispatchBoard is not a constructor" on the "dispatch = new window.dispatchBoard();" line.

What am i doing wrong?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month