i have kinda strange issue here.
i have an item form. on that form i placed a webpart list view. this webpart list view is binded to my item by ID. this ID i placed in a simple input text field.
when i create a new item before it is saved it doesn't have any id. this is why reserve id by ajax call and place this id manually by JS code in this input text field.
here comes crazy stuff.
my webpart doesn't care what's inside this field. it looks in a strange hidden field.
example
<input id="ClientFormPostBackValue_d9b40d1c-cf2b-4100-ad10 d3c6dacac11c_MY-ID-FIELD" name="ClientFormPostBackValue_d9b40d1c-cf2b-4100-ad10-d3c6dacac11c_MY-ID-FIELD" type="hidden" value="MY_RESERVED_ID">
whenever i manually change my ID in my input text field it synchronize value with this hidden field. A-OKEY i tried to change this field also by JS code and it started to work and my webpart list view started to show elements in all browsers EXCEPT Internet Exploer (!).
for god sake, what's wrong with this browser.
I found that i can use CSR for entering ID in this field and using something like this:
ctx.CurrentFieldValue = RESERVED_ID;
SPFieldText_Edit(ctx);
BUT i can't use CSR because i use AJAX for getting this ID.
guys, please help...
UDPATE:
here's my code.
getFuncID("MY-LIST").then(function (data) {
//reservedID - ID which i got from AJAX
reservedID = data.d.ReserveListItemId + 1;
//set value for hidden field. works except IE.
$('#WPQ2ClientFormPlaceholder').find('input[id$="MY-ID-FIELD"]').attr('value', reservedID );
...
});
//AJAX call, using rest call
getFuncID: function (listName) {
return $.ajax({
url: "/_api/web/lists/getByTitle('" + listName + "')/reserveListItemId",
type: "POST",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
}
});
}
UPDATE2:
i found that whenever i manually change value of input text field. it fires some JS code from clientforms.js.
function i() {
b != null && a.updateControlValue(a.fieldName, b.value)
}
how to trigger this event through JS. maybe it would help? what do you think?
.click()
... Have you searched before asking a question!? Please do so next time.. I found this in a minute.. sharepoint.stackexchange.com/questions/112232/…