Skip to main content

Here is the code so far iI have tried:

var query = new SP.CamlQuery(); var textCAML = '15 '; query.set_viewXml(textCAML);

var items = list.getItems(query);

var query = new SP.CamlQuery();
var textCAML = '<View><Query><RowLimit></RowLimit>15 </Query></View>';
query.set_viewXml(textCAML);

var items = list.getItems(query);


clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

The newEvent array couldn't fetch events from the sharepointSharePoint list.

I used the camel query but still couldn't fetch. Should I use while((enumerator.moveNext()))while((enumerator.moveNext())) ?

Here is the code so far i have tried:

var query = new SP.CamlQuery(); var textCAML = '15 '; query.set_viewXml(textCAML);

var items = list.getItems(query);

clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

The newEvent array couldn't fetch events from the sharepoint list.

I used the camel query but still couldn't fetch. Should I use while((enumerator.moveNext())) ?

Here is the code so far I have tried:

var query = new SP.CamlQuery();
var textCAML = '<View><Query><RowLimit></RowLimit>15 </Query></View>';
query.set_viewXml(textCAML);

var items = list.getItems(query);


clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

The newEvent array couldn't fetch events from the SharePoint list.

I used the camel query but still couldn't fetch. Should I use while((enumerator.moveNext())) ?

added 241 characters in body
Source Link
gunu
  • 75
  • 4
  • 12

var query = new SP.CamlQuery(); var textCAML = '15 '; query.set_viewXml(textCAML);

var items = list.getItems(query);

var items = list.getItems("");

clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

The newEvent array couldn't fetch events from the sharepoint list.

I used the camel query but still couldn't fetch. Should I use while((enumerator.moveNext())) ?

var items = list.getItems("");

clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

The newEvent array couldn't fetch events from the sharepoint list.

var query = new SP.CamlQuery(); var textCAML = '15 '; query.set_viewXml(textCAML);

var items = list.getItems(query);

clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

The newEvent array couldn't fetch events from the sharepoint list.

I used the camel query but still couldn't fetch. Should I use while((enumerator.moveNext())) ?

formatted
Source Link
Amal Hashim
  • 28.4k
  • 5
  • 32
  • 61

Here is the code so far i have tried: //////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////

var items = list.getItems("");

clientContext.load(items); //Execute the Query Asynchronously clientContext.executeQueryAsync(onSuccess, onFail); function onSuccess() { var enumerator = items.getEnumerator();

var items = list.getItems("");

clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}

}

function onFail(sender, args) { alert(args.get_message()); }

function CalendarSetup() {

}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}

}

Here is the code so far i have tried: //////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////

var items = list.getItems("");

clientContext.load(items); //Execute the Query Asynchronously clientContext.executeQueryAsync(onSuccess, onFail); function onSuccess() { var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}

}

function onFail(sender, args) { alert(args.get_message()); }

function CalendarSetup() {

schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});

}

Here is the code so far i have tried:

var items = list.getItems("");

clientContext.load(items);
//Execute the Query Asynchronously
clientContext.executeQueryAsync(onSuccess, onFail);
function onSuccess() {
var enumerator = items.getEnumerator();

for (var i = 0; i < enumerator.length; i++) {
    var currentListItem = enumerator.get_current();
    NewEvents.push({
        ID: enumerator[i].get_id(),
        title: enumerator[i].get_item('task')
    });
}
}

function onFail(sender, args) {
    alert(args.get_message());
}



function CalendarSetup() {
schedulecCalendar = $('#myCalendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: ''
    },
    theme: true,
    defaultView: 'month',
    selectable: true,
    events: NewEvents,
    selectHelper: true,
    height: 500,
    rendering: true,
    select: function (start, end, allDay) {
        $('#txtDate').datepicker("setDate", new Date(start));
        $(".collapse").collapse('show');
    },
    editable: true,

    eventClick: function (calEvent, jsEvent, view) {
        $('#eventTitle').val(calEvent.title);
        $('#calEventDialog #allday').val([calEvent.className == "gbcs-halfday-event" ? "1" : "2"]).prop('checked', true);
        $("#calEventDialog").dialog();

        $("#calEventDialog").dialog("option", "buttons", [
          {
              text: "Edit",
              click: function () {
                  calEvent.title = $('#eventTitle').val();
                  $('#myCalendar').fullCalendar('updateEvent', calEvent);
                  $(this).dialog("close");
              }
          },
        {
            text: "Delete",
            click: function () {
                $('#myCalendar').fullCalendar('removeEvents', calEvent._id);
                $(this).dialog("close");
            }
        },
        {
            text: "Cancel",
            click: function () {
                $(this).dialog("close");
            }
        }
        ]);
        $("#calEventDialog").dialog("option", "title", "Edit Event");
        $('#calEventDialog').dialog('open');
    },
});
}
added 2621 characters in body
Source Link
gunu
  • 75
  • 4
  • 12
Loading
edited tags
Link
gunu
  • 75
  • 4
  • 12
Loading
Source Link
gunu
  • 75
  • 4
  • 12
Loading