- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2023 02:48 AM
Hi all,
I'm struggling with passing data from a modal to the server in a SP list widget.
Within this modal, I am passing the selected date through an id of "newExpiryDate"
Here is the client script:
c.Expiry = function () {
swal({
position: 'top-end',
type: 'success',
title: 'iManage Share Extended',
showConfirmButton: true
});
// Set the action and new expiry date in the data object
c.data.action = 'Expiry';
c.data.newExpiryDate = c.newExpiryDate;
// Send the data to the server-side script
c.server.update().then(function () {
c.data.action = undefined;
spUtil.addInfoMessage("Share Extended", 3000);
c.modalInstance.close();
});
};
The action is being called in the server script:
if (input && input.action === 'Expiry') {
data.newExpiryDate = input.newExpiry;
gr.u_share_expiry = input.newExpiryDate;
gr.update();
}
But the field remains blank, I've tried a few approaches to this and just can't get it to work. If a date is present in the field, the field is cleared when you submit.
Many thanks for the help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2023 06:32 AM
I've managed to figure it out - we just need to reference ng-model in the modal, e.g. ng-model="data.newExpiry"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2023 04:36 AM - edited ‎03-09-2023 08:05 AM
more details please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2023 06:06 AM
Thanks Sankar,
I also managed to get the exact same response from ChatGPT although this doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2023 06:32 AM
I've managed to figure it out - we just need to reference ng-model in the modal, e.g. ng-model="data.newExpiry"