问题描述
我试图通过使用REST API查询SharePoint结果源来查看是否可以使用Jqgrid显示SharePoint搜索结果。
使用REST API调用结果源的代码可在浏览器和Postman中使用:
var apiUrl = _spPageContextInfo.webAbsoluteUrl + / _ api / search / query?querytext ='Mike'&rowlimit = 100&selectproperties ='RequestNameOWSTEXT,SubmittedByOWSUSER,ExaminiationNameOWSTEXT,PublishedDate1OWSDATE&sourceId ='d90c19xx-7b3x-42bx-8,fx返回。
但是当我在Jqgrid中使用它时,在第44行出现错误:未捕获的TypeError:无法读取未定义的属性'length'
$。ajax({url:apiUrl,type:“ GET”,async:false,标头:{“ accept”:“ application / json; odata = verbose”},成功:function(data){
第44行:$ .each(data.d.results,function(index,value){.................................... ..
我想api调用不会返回结果,因此数据是不确定的。想知道该API有什么问题吗?
以下类似的api可以返回结果:
var apiUrl = _spPageContextInfo.webAbsoluteUrl +“ / _api / web / GetFolderByServerRelativeUrl('documentrequest')/ Folders?$ expand = ListItemAllFields,AuthorID / id&id&$ select = Name,ItemCount,ListItemAllFields / AuthorId,ListItemAllFields / ExaminiName PublishedDate1&$ filter =名称为'Forms'和ItemCount gt 0“;