So I am having an issue with a Sharepoint App I am developing. Upon a button click I would like one screen to change the status of an item, close the pop up box and open a new pop up box to another window. So my understanding of the ng-click function is that it should be able to achieve my goal of running two functions simultaneously. So my code was working fine in terms of updating the item but once I added in the following line I expected this to achieve two of my aims 1. Change the items status and 2. Close the window.
<input ng-disabled="saving" type="button" value="Accept" ng-click="approval(true); $close()">
What happened instead though is it broke the original code and now the items status is not updating nor is it closing.
The Original Code which achieved changing the Item
<div ng-show="tab == 'New'">
<table style="width: 100%;">
<tr>
<th>Reasons</th>
<td>
<select ng-model="Reason" ng-change="ReasonChange()">
<option value="Inadequate instructions provided">Inadequate instructions provided</option>
<option value="Document missing">Document missing</option>
<option value="Outside of remit">Outside of remit</option>
</select>
</td>
</tr>
<tr>
<th colspan="2" style="text-align: left">Comments (this will be emailed to the customer)</th>
</tr>
<tr>
<td colspan="2"><textarea ui-tinymce="tinymceOptions" ng-model="a.Body" style="height: 200px;"></textarea></td>
</tr>
</table>
<div>
<input ng-disabled="saving" type="button" value="Accept" ng-click="approval(true)"> <!--1st Approval Screen accept-->
<input ng-disabled="saving" type="button" value="Reject" ng-click="approval(false)" /> <!--1st Approval Screen reject-->
<input type="button" value="Close" ng-click="$close()" /> <!--1st Approval Screen Close-->
</div>
The New Code which was supposed to achieve changing the Item and closing the window box
<div ng-show="tab == 'New'">
<table style="width: 100%;">
<tr>
<th>Reasons</th>
<td>
<select ng-model="Reason" ng-change="ReasonChange()">
<option value="Inadequate instructions provided">Inadequate instructions provided</option>
<option value="Document missing">Document missing</option>
<option value="Outside of remit">Outside of remit</option>
</select>
</td>
</tr>
<tr>
<th colspan="2" style="text-align: left">Comments (this will be emailed to the customer)</th>
</tr>
<tr>
<td colspan="2"><textarea ui-tinymce="tinymceOptions" ng-model="a.Body" style="height: 200px;"></textarea></td>
</tr>
</table>
<div>
<input ng-disabled="saving" type="button" value="Accept" ng-click="approval(true); $close()"> <!--1st Approval Screen accept-->
<input ng-disabled="saving" type="button" value="Reject" ng-click="approval(false)" /> <!--1st Approval Screen reject-->
<input type="button" value="Close" ng-click="$close()" /> <!--1st Approval Screen Close-->
</div>
I am confused as I believe ng-click="approval(true); $close()" is the correct way to call two js functions in one click.
The other issue I have is navigating to another window from the one in my attached picture. Is there a way as part of the ng-click to navigate to another window in the javascript?
Thanks a lot everyone for any information that can help me.
