Sharepoint Ajax列表数据填充器示例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sharepoint Ajax列表数据填充器示例相关的知识,希望对你有一定的参考价值。
function btnSubmitEntry_OnClick() { $('#contentLoading').show(); var ourAffectedUrl = EscapeHtmlString($('#selUrl :selected').text()); var ourStagingUrl; if (ourAffectedUrl.indexOf('/') == 0) { if (ourProperty.indexOf('MS.com') > -1) ourStagingUrl = "http://wwwstaging" + ourAffectedUrl; else if (ourProperty.indexOf('http://') > -1) ourStagingUrl = "http://standards" + ourAffectedUrl; else ourStagingUrl ="n/a"; } else if ((ourAffectedUrl == "new page") || (ourProperty == "talkstandards.com")) ourStagingUrl ="to be determined" ; else ourStagingUrl ="n/a" ; var updateString = "<Batch OnError="Continue">"; updateString += "<Method ID="1" Cmd="New">"; updateString += "<Field Name="ID">1</Field>"; //updateString += "<Field Name="Title">" + EscapeHtmlString($("#txtTitle").val()) + "</Field>"; updateString += "<Field Name="Title">Bug or Change Request </Field>"; updateString += "<Field Name="Property">" + ourProperty + "</Field>"; updateString += "<Field Name="Property_x0020_Owner">" + getPropertyOwner($('#selProperty :selected').text()) + "</Field>"; updateString += "<Field Name="URL_x0020_Affected">" + ourAffectedUrl + "</Field>"; updateString += "<Field Name="The_x0020_Requester">" + EscapeHtmlString($("#txtAuthor").val()) + "</Field>"; updateString += "<Field Name="staging_x0020_url">" + ourStagingUrl + "</Field>"; updateString += "<Field Name="Description">" + EscapeHtmlString($("#txtDescript").val()) + "</Field>"; updateString += "<Field Name="Priority_x0020_Level">" + EscapeHtmlString($('#selPriority :selected').text()) + "</Field>"; updateString += "<Field Name="Type_x0020_of_x0020_Request">" + EscapeHtmlString($('#selType :selected').text()) + "</Field>"; updateString += "<Field Name="Go_x0020_Live_x0020_Date">" + EscapeHtmlString($("#txtGoLiveDate").val()) + "</Field>"; updateString += "<Field Name="Go_x0020_Live_x0020_Time">" + EscapeHtmlString($("#txtGoLiveTime").val()) + "</Field>"; updateString += "<Field Name="PageSection">" + EscapeHtmlString($("#txtSection").val()) + "</Field>"; updateString += "</Method>"; updateString += "</Batch>"; try { UpdateListItems("Change Requests", updateString, callback_Submit); } catch (err) { alert(err.message); } } function callback_Submit(respObj, status) { var soapError = SoapErrorCheck(respObj); if (soapError.length == 0) { if (respObj.xml.length > 0) { var rows = $("z\:row", respObj); requestID = trim($(rows[0]).attr("ows_ID")) var editUrl = $("a#attachLink").attr("href") + "?ID=" + requestID; var attachmentUrl = $("a#custom-popup").attr("href") + "?ID=" + requestID; $("a#attachLink").attr("href", editUrl ); $("a#custom-popup").attr("href", attachmentUrl ); $('#submittalConfirmation').show(); $('#requestForm').hide(); $('#contentLoading').hide(); } else { alert("Error updating request list. Try again and if the error continues please contact your administrator."); } } else { alert("Error submitting your request: " + soapError); } }
以上是关于Sharepoint Ajax列表数据填充器示例的主要内容,如果未能解决你的问题,请参考以下文章
jquery用ajax方式从后台获取json数据后如何将内容填充到下拉列表
SharePoint REST API。在 SharePoint 列表上进行 AJAX 调用时出现 400 错误请求
JavaScript Sharepoint Ajax List Data populater示例