search panels
search panels
I am having issues with the following code:
CaseActionsEditor.on('submitSuccess', function () {
CasesTable.ajax.reload();
CasesTable.searchPanes.rebuild();
});
CasesTable has some mjoins going on that are used in the searchPanes
in the code below, upon certain circumstances, a new record is created in CalendaredEvents
CaseActionsEditor.on('postSubmit', function (e, json, data, action, xhr) {
var actionID = CaseActionsEditor.get('CaseActions.ActionID');
var needsCalendarRecord = 0;
if (actionID > 0) {
$.ajax({
url: 'api/Actions?actionID=' + actionID,
dataType: 'json',
async: false,
success: function (response) {
needsCalendarRecord = response.data[0]["NeedsCalendarEvent"];
if (needsCalendarRecord == '1') {
$.ajax({
url: 'api/CalendaredEvents?caseID=' + selectedCaseID + '&actionID=' + actionID,
dataType: 'json',
async: false,
success: function (response) {
if (response.data.length == 0) { //no existing calendar event exists, so add one
var self = CalendaredEventsEditor;
self.create(false)
.set({
'CalendaredEvents.CaseID': selectedCaseID,
'CalendaredEvents.ActionID': actionID
})
.submit();
alert("A new Calendar Event has been created.");
}
}
})
}
}
})
}
});
however, calendaredEvents can also have records added manually (and are also used in CaseTable mjoins and the searchPanes) so I have the following code:
CalendaredEventsEditor.on('submitSuccess', function () {
CasesTable.ajax.reload();
CasesTable.searchPanes.rebuildPane();
CalendaredEventHistoryTable.ajax.reload();
});
I get this error when I try to add CaseActions record: RangeError: Maximum call stack size exceeded
And if the CaseActions results in the creation of a new CalendaredEvents record, I get this message after the record is created: Cannot read property 'searchPanes' of null
Answers
here is my Cases Controller:
vw_Alerts has data from CaseActions and CalendaredEvents.
and here is the Cases Editor/DataTable:
Could you try the nightly of SearchPanes please? I recall there was an infinite loop resolved recently recently.
If that doesn't resolve it, can you link to a test case showing the issue please?
Allan
sorry for the delay, I have been away from this project for a bit.
I switched to the nightly and am getting this error on submit of CaseActionsEditor:
and I still get the error if Actions creates a calendar event:
unfortunately this is not on a server that can be reached by the public. Is there any other information I can share?
You can provide a link to a test case.
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
Yep, as tangerine said, just a simple test case on http://live.datatables.net/ that demonstrates the issue would be the best way to move this forward. It doesn't need any complexity, just the minimum to reproduce the errors.
Colin