Hi,
I believe this could be done in many ways.
Here is the approach I would use :
1) Create a javascript file to insert a blank item in your list
function createListItem(siteUrl) {
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('Announcements');
var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', 'My New Item!');
oListItem.set_item('Body', 'Hello World!');
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded),
Function.createDelegate(this, this.onQueryFailed)
);
}
function onQuerySucceeded() {
alert('Item created: ' + oListItem.get_id());
//This is where I would open a window with the EditForm of the previously created blank item
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() +
'\n' + args.get_stackTrace());
}
Source : https://msdn.microsoft.com/en-us/library/office/jj163201.aspx
2) Create a new "Add item" button using a script editor WebPart with an event to trigger the
createListItem function.
3) Inside the
onQuerySucceeded Retrieve the ID and open the EditForm on your list :
Ex:
http://yourSite/Lists/YourListName/Editform.aspx?ID=" + oListItem.get_id()
Regards
Samuel Levesque | http://sharepointerie.com |
Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.