Click here to Skip to main content
15,886,067 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionAssignment Help Pin
Member 150639523-Feb-21 13:12
Member 150639523-Feb-21 13:12 
AnswerRe: Urgent Java Assignment Help Pin
Richard Deeming3-Feb-21 21:45
mveRichard Deeming3-Feb-21 21:45 
Questionhow can i unmute a video using js for chrome Pin
Member 148717432-Feb-21 23:28
Member 148717432-Feb-21 23:28 
AnswerRe: how can i unmute a video using js for chrome Pin
Richard Deeming3-Feb-21 0:41
mveRichard Deeming3-Feb-21 0:41 
QuestionTrying to limit a input type=text only decimal values with 2 digits after decimal Pin
simpledeveloper1-Feb-21 21:14
simpledeveloper1-Feb-21 21:14 
AnswerRe: Trying to limit a input type=text only decimal values with 2 digits after decimal Pin
Richard Deeming1-Feb-21 21:47
mveRichard Deeming1-Feb-21 21:47 
GeneralRe: Trying to limit a input type=text only decimal values with 2 digits after decimal Pin
simpledeveloper2-Feb-21 6:43
simpledeveloper2-Feb-21 6:43 
QuestionIs there a delicate way to pass calendar events variables in Javascript Pin
Member 1505943129-Jan-21 0:04
Member 1505943129-Jan-21 0:04 
I am not sure, if I could solve this problem within the Javascript code.

As you can see from the example below, I have a @ model which contains data.

In order to use particular parts of the data, I have assigned it to a Json object by using Json.Serialize .The reason I have done so, is that the events:[ ] section accepts data in some specific format, looking like a json kind of format.

As you can see in the events:[ ] section, I have tried to extract data in such a way so that the events:[ ] part of the program accepts it. (and everything works fine like that)

Problem is that, the number of records in json can vary as it pulls data from a database table.

Desired outcome is: A better formulation to introduce neccessary data in the events:[ ] section.

I would be very happy If you could suggest something about it. Thank you.
@ model IEnumerable<WebAppV2.Models.CalendarEvent>

<script>

    document.addEventListener('DOMContentLoaded', function () {
        var calendarEl = document.getElementById('calendar');

      var json = @ Html.Raw(Json.Serialize(@ Model));

        var calendar = new FullCalendar.Calendar(calendarEl, {
            initialDate: '2021-01-01',
            editable: false,
            selectable: false,
            businessHours: true,
            dayMaxEvents: true,
            events: [

                {
                    title: json[0].title,
                    start: json[0].start,
                    end: json[0].end
                },

                {
                    title: json[1].title,
                    start: json[1].start,
                    end: json[1].end
                },

                {
                    title: json[2].title,
                    start: json[2].start,
                    end: json[2].end
                },

            ]
        });

        calendar.render();
    });

</script>

AnswerRe: Is there a delicate way to pass calendar events variables in Javascript Pin
Richard Deeming29-Jan-21 0:16
mveRichard Deeming29-Jan-21 0:16 
GeneralRe: Is there a delicate way to pass calendar events variables in Javascript Pin
Member 1505943129-Jan-21 1:58
Member 1505943129-Jan-21 1:58 
GeneralBuild an entire React application in one command Pin
DonJon28-Jan-21 19:22
DonJon28-Jan-21 19:22 
GeneralRe: Build an entire React application in one command Pin
Richard Deeming28-Jan-21 22:14
mveRichard Deeming28-Jan-21 22:14 
QuestionBest way to trace JavaScript Conflict Pin
ReverseAds10-Jan-21 20:35
ReverseAds10-Jan-21 20:35 
QuestionRe: Best way to trace JavaScript Conflict Pin
Sandeep Mewara10-Jan-21 21:13
mveSandeep Mewara10-Jan-21 21:13 
AnswerRe: Best way to trace JavaScript Conflict Pin
20212a15-Jan-21 8:16
20212a15-Jan-21 8:16 
AnswerRe: Best way to trace JavaScript Conflict Pin
F-ES Sitecore28-Jan-21 21:24
professionalF-ES Sitecore28-Jan-21 21:24 
Questionhow to convert a function in to arrow function Pin
Member 139980429-Jan-21 0:56
Member 139980429-Jan-21 0:56 
AnswerRe: how to convert a function in to arrow function Pin
Afzaal Ahmad Zeeshan9-Jan-21 4:35
professionalAfzaal Ahmad Zeeshan9-Jan-21 4:35 
SuggestionRe: how to convert a function in to arrow function Pin
Richard Deeming11-Jan-21 22:41
mveRichard Deeming11-Jan-21 22:41 
QuestionQuiz Issue Pin
Shobhit Rathour30-Dec-20 3:35
Shobhit Rathour30-Dec-20 3:35 
AnswerRe: Quiz Issue Pin
Afzaal Ahmad Zeeshan9-Jan-21 5:02
professionalAfzaal Ahmad Zeeshan9-Jan-21 5:02 
QuestionReplacing the eval() function with something faster, more safe Pin
jkirkerx21-Dec-20 7:52
professionaljkirkerx21-Dec-20 7:52 
AnswerRe: Replacing the eval() function with something faster, more safe Pin
Graham Breach21-Dec-20 8:27
Graham Breach21-Dec-20 8:27 
GeneralRe: Replacing the eval() function with something faster, more safe Pin
jkirkerx21-Dec-20 9:21
professionaljkirkerx21-Dec-20 9:21 
Questionhigher order functions Pin
atomattacker-png21-Dec-20 1:49
atomattacker-png21-Dec-20 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.