내 모든 선택한 목록 항목을 다른 (사용자 지정) 목록으로 복사하는 스크립트가 필요합니다. 내가 정상 목록 항목에 대한 작업을 진행하게 변경해야 할 무엇인지 잘 모릅니다선택한 목록 항목을 ECMA 스크립트로 다른 목록에 복사
var context = SP.ClientContext.get_current();
var web = context.get_web();
context.load(web);
var _destinationlib = web.get_lists().getByTitle('DestinationLibrary');
context.load(_destinationlib);
var notifyId;
var currentlibid = SP.ListOperation.Selection.getSelectedList();
var currentLib = web.get_lists().getById(currentlibid);
var selectedItems = SP.ListOperation.Selection.getSelectedItems(context);
var count = CountDictionary(selectedItems);
for(var i in selectedItems)
{
alert('Now copying ' + i);
var currentItem = currentLib.getItemById(selectedItems[i].id);
context.load(currentItem);
var File = currentItem.get_file();
context.load(File);
//Excecuting executeQueryAsync to get the loaded values
context.executeQueryAsync
(
function (sender, args) {
if(File != null) {
var _destinationlibUrl = web.get_serverRelativeUrl() + _destinationlib.get_title() + '/' + File.get_name();
File.copyTo(_destinationlibUrl, true);
notifyId = SP.UI.Notify.addNotification('Moving file…' + File.get_serverRelativeUrl() + 'to' + _destinationlibUrl, true);
//Excecuting executeQueryAsync to copy the file
context.executeQueryAsync(
function (sender, args) {
SP.UI.Notify.removeNotification(notifyId);
SP.UI.Notify.addNotification('File copied successfully', false);
},
function (sender, args) {
SP.UI.Notify.addNotification('Error copying file', false);
SP.UI.Notify.removeNotification(notifyId);
showError(args.get_message());
});
}
},
function (sender, args) {
alert('Error occured' + args.get_message());
}
);
}
: 나는 문서에 대한 좋은 해결책을 발견했다. 나는
var title = currentItem.get_Title();
context.load(title);
var number = currentItem.get_item('number');
context.load(number);
와
var File = currentItem.get_file();
context.load(File);
를 교환하기 위해 노력하지만, 작품을 dosnt. 누군가가 내게해야 할 힌트를 줄 수 있다면 좋을 것입니다.
많은 들으
Fabulus