2

Here I want to update SP calendar List's events for that,I want to read the event id of specific event, how to do that?Here I have one table which represent data along with some time values at Table header and there are some empty(white colored) cells in that table which represent booking for vehicles,and there am implementing drag and drop functionality on table cells means when am dragging the booked(Red Colored) cell ,then i have a current date and then i want to change time of that event as per the cell header under which am dropping my booked(Red Colored) cell,for doing this stuff i wan to get the event Id of each event for performing updation operation,my table looks like bellow snippet
enter image description here

  • You need to add more details to this post, what have you tried so far and so on? – Robert Lindgren Sep 6 '16 at 11:28
1

Resolved the issue by applying below code on dragstart event

           var evntId=0;
            $('.bookedcell').on("dragstart", function (event) {
                var dt = event.originalEvent.dataTransfer;
                dt.setData('Text', $(this).attr('id'));   
                var vehicleName = $(this).closest('td').parent('tr').find('td:eq(0)').text();          
                var index = $(this).closest('td').index();
                var headerText = $("table th").eq(index).text();
                while (enumerator2.moveNext()) {  

                    var currentListItem = enumerator2.get_current();
                    var vehiclenm=currentListItem.get_item('Name');               
                    var startdte = currentListItem.get_item('EventDate').toString().split(" ");
                    var eventId=currentListItem.get_item('ID');
                    var month=months.indexOf(startdte[1]);
                    if(month<10)
                    {
                        month="0"+month;
                    }
                    var day=startdte[2];
                    var year=startdte[3];
                    var convertedDte=month+"/"+day+"/"+year;
                    var eventEnteredDate = document.getElementById("YourDate").innerHTML;
                    var dateToCompare = moment(evententereddate, 'DD/MM/YYYY').format("MM/DD/YYYY");

                    if(convertedDte=== dateToCompare)
                    {
                        var startdte_time = startdte[4].toString().split(":");
                        var enddte = currentListItem.get_item('EndDate').toString().split(" ");
                        var enddte_time = enddte[4].toString().split(":");
                        var headerTiming = startdte_time[0] + ":" + startdte_time[1] + "-" + enddte_time[0] + ":" + enddte_time[1];   
                        if(vehicleName===vehiclenm && headerTiming === headerText)
                        {
                            evntId=eventId;
                        }                     
                    }
                }
            });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.