I am trying call the loadTimesheet function in object weeklytimesheet from another js file.
I get a Object doesn't support property or method 'loadTimesheet' error.
EDIT: My intellisense in VS2012 is not working either if that has any bearing on it.
mylester.index.js
$(document).ready(function () {
$("#newtimesheet").click(function () {
weeklytimesheet.loadTimesheet();
});
});
mylester.weeklytimesheet.js
var weeklytimesheet = new function () {
load = function () {
var wkending = getWeekEnding();
var proId = $("#newtimesheet").attr("proid");
$("#divtimesheet").load("/Timesheet/NewTimesheet", new { proId: proID, enddate: wkending });
open();
};
open = function() {
$("#clipboarddialog").dialog({
autoOpen: true,
height: 800,
width: 860,
modal: true,
title: "Edit Timesheet",
buttons: {
"Save": function () {
editorForm.saveForm();
$(this).dialog("close")
},
Cancel: function () { $(this).dialog("close") }
}
});
};
getWeekEnding = function () {
var wkending;
$(".datepicker").datepicker();
$("#datepickerdialog").dialog({
autoOpen: true,
close: function () {
wkending = $("#weekending").val();
},
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
}
});
return wkending;
}
return
{
loadTimesheet: load
};
}();