Catch possible errors while Starting new case. Most of errors are due an invalid JSON response from server. So now that is catched and displayed

This commit is contained in:
Hugo Loza
2010-12-22 19:21:51 +00:00
parent c9e22777e7
commit 4c7009ea41

View File

@@ -363,7 +363,8 @@ var startCaseTab = {
function chDir( directory, loadGridOnly ) {
//console.info("**** Changing Directory: "+directory+" -- "+loadGridOnly);
// console.info("**** Changing Directory: "+directory+" --
// "+loadGridOnly);
if( datastore.directory.replace( /\//g, '' ) == directory.replace( /\//g, '' )
&& datastore.getTotalCount() > 0 && directory != '') {
// Prevent double loading
@@ -1081,16 +1082,15 @@ var gridtb = new Ext.Toolbar(
disabled : false,
handler : function() {
/*
Ext.ux.OnDemandLoad
.load("/scripts/extjs3-ext/ux.swfupload/SwfUploadPanel.css");
Ext.ux.OnDemandLoad
.load("/scripts/extjs3-ext/ux.swfupload/SwfUpload.js");
Ext.ux.OnDemandLoad
.load(
"/scripts/extjs3-ext/ux.swfupload/SwfUploadPanel.js",
function(options) {
openActionDialog(this, 'upload');
});*/
* Ext.ux.OnDemandLoad
* .load("/scripts/extjs3-ext/ux.swfupload/SwfUploadPanel.css");
* Ext.ux.OnDemandLoad
* .load("/scripts/extjs3-ext/ux.swfupload/SwfUpload.js");
* Ext.ux.OnDemandLoad .load(
* "/scripts/extjs3-ext/ux.swfupload/SwfUploadPanel.js",
* function(options) { openActionDialog(this, 'upload');
* });
*/
openActionDialog(this, 'uploadDocument');
}
},
@@ -1729,8 +1729,10 @@ var documentsTab = {
if (!selections[0]
.get('is_file')) {
// console.log(datastore.directory);
chDir(/*datastore.directory
+ "/"+*/selections[0]
chDir(/*
* datastore.directory +
* "/"+
*/selections[0]
.get('id'));
} else if (selections[0]
.get('is_editable')) {
@@ -1773,13 +1775,12 @@ var documentsTab = {
// alert(Ext.getCmp("locationbarcmp"));
// Ext.getCmp("documents").
/*
if(typeof(sw_afterlayout)!="undefined"){
//console.log("starting locatiobar");
Ext.getCmp("locationbarcmp").tree = Ext.getCmp("dirTree");
Ext.getCmp("locationbarcmp").initComponent();
//console.log("location abr started");
return;
}
* if(typeof(sw_afterlayout)!="undefined"){
* //console.log("starting locatiobar");
* Ext.getCmp("locationbarcmp").tree =
* Ext.getCmp("dirTree");
* Ext.getCmp("locationbarcmp").initComponent();
* //console.log("location abr started"); return; }
*/
// console.log(typeof(sw_afterlayout));
sw_afterlayout=true;
@@ -1892,6 +1893,7 @@ Ext
calendarDays=(otherAttributes.CALENDAR_WORK_DAYS).split("|");
calendarObj={};
for(i=0;i<calendarDays.length;i++){
calendarObj[calendarDays[i]]=true;
}