【发布时间】:2012-07-13 15:31:29
【问题描述】:
我正在使用带有 SPServices 的 jQuery Mobile 将 SharePoint 数据拉入移动页面。所有数据都实际加载,但我没有成功让 spinner 在拉取数据时加载。
我在几页上阅读了您必须设置 async: true 才能使其正常工作,但这没有帮助。我还尝试了几种显示和隐藏微调器的方法,但都不起作用。
- jQuery 1.7.2
- jQuery Mobile 1.1.0
- SPServices 0.7.1a http://spservices.codeplex.com/
有什么想法吗?
不起作用
$(document).delegate('#top-stories', 'pageshow', function () {
function getList(){
// ....
} // end function
$.mobile.showPageLoadingMsg();
getList();
$.mobile.hidePageLoadingMsg();
});
不起作用
$(document).delegate('#top-stories', 'pageshow', function () {
function getList(){
$.mobile.showPageLoadingMsg();
$().SPServices({
// ....
});
$.mobile.hidePageLoadingMsg();
} // end function
getList();
});
加载项目和工作的代码,只是没有微调器
$(document).delegate('#top-stories', 'pageshow', function () {
function getList(){
$().SPServices({
operation: "GetListItems",
listName: "Posts",
webURL: "/SiteDirectory/news_and_updates",
async: true,
CAMLRowLimit: 15,
CAMLQuery: "<Query><OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy><Where><Eq><FieldRef Name='PostCategory' /><Value Type='Choice'>Announcements</Value></Eq></Where></Query>",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='ID' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var liHtml = "<li data-theme=\"c\"><a href=\"javascript:viewStory(" + $(this).attr("ows_ID") + ")\">" + $(this).attr("ows_Title") + "</a></li>";
$("#top-stories ul").append(liHtml).listview("refresh");
});
}
});
} // end function
getList();
});
【问题讨论】:
标签: jquery jquery-plugins jquery-mobile