Created
April 11, 2012 22:32
-
-
Save jjaramillo/2363211 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebserviceCall = function () { | |
{ | |
var enable = true; | |
var listId = SP.ListOperation.Selection.getSelectedList(); | |
var items = SP.ListOperation.Selection.getSelectedItems(); | |
if (items.length == 0) | |
return false; | |
var selectedIds = new Array(); | |
for (var i in items) { | |
selectedIds.push(parseInt(items[i].id)); | |
} | |
//The list id is a GUID string like, i.e. "{77c51b5a-fb48-4228-8c92-ee5834d7fefc}" | |
var data = { selectedIds: selectedIds, listId: listId }; | |
jQuery.ajax({ | |
url: "/sites/docs/_vti_bin/RibbonMethods.asmx/IsAnyDocumentScheduled", | |
type: "POST", | |
dataType: "json", | |
data: JSON.stringify(data), async: false, | |
success: function (result, status) { | |
enable = result.d; | |
}, | |
error: function (jqXHR, textStatus, errorThrown) { | |
MS.InformationManagement.Common.ShowStatus(jqXHR.responseText, 'red', 6000); | |
enable = false; | |
}, | |
contentType: "application/json; charset=\"utf-8\"" | |
}); | |
return enable; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment