Click here to Skip to main content
15,888,579 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: web development MVC Codeignatir Pin
User 418025416-Apr-17 16:48
User 418025416-Apr-17 16:48 
QuestionWordpress & Bootstrap Free Tutorials Pin
Member 130993471-Apr-17 5:31
Member 130993471-Apr-17 5:31 
AnswerRe: Wordpress & Bootstrap Free Tutorials Pin
ZurdoDev6-Apr-17 2:09
professionalZurdoDev6-Apr-17 2:09 
QuestionPHP ONE TO ONE CHAT ISSUE Pin
Member 1178652227-Mar-17 3:35
Member 1178652227-Mar-17 3:35 
AnswerRe: PHP ONE TO ONE CHAT ISSUE Pin
ZurdoDev29-Mar-17 6:00
professionalZurdoDev29-Mar-17 6:00 
QuestionPHP Booking form Pin
lapeci27-Mar-17 2:18
lapeci27-Mar-17 2:18 
AnswerRe: PHP Booking form Pin
Jochen Arndt27-Mar-17 3:04
professionalJochen Arndt27-Mar-17 3:04 
QuestionWebGrid Update From SignalR Pin
Kevin Marois24-Mar-17 6:08
professionalKevin Marois24-Mar-17 6:08 
I posted this in the Lounge yesterday. I'm feeling pretty good about getting my app working.

Then Sander asked this question, so I thought I'd start this thread to get more info.

Thanks for pointing out my folly Sander. Poke tongue | ;-P

Here is the JavaScript code that I have now. It listens to a SignalR service, which notifies it when a record is changed. Right now I have an ajax call that refreshes the whole grid. Ya, bad idea.. but I just wanted to get it working.
JavaScript
<script src="/Scripts/jquery-3.1.1.min.js"></script>
<script src="/Scripts/jquery.signalR-2.1.2.js"></script>
<script src="~/signalr/hubs"></script>

<script type="text/javascript">
    $(function () {

<pre>
    var conn = $.hubConnection("http://blah:8094/signalr");
    var proxy = conn.createHubProxy('dashboardHub')

    proxy.on('notifyAllClientsOfChanges', function () {

        var searchUrl = "Index/GetData";

        $.ajax({
            url: searchUrl,
            type: "POST",
            success: function (data) {
                $("#divData").html(data);
            }
        });

    });

    conn.start().done(function ()
    {
        console.log("Connected!!!");

    }).fail(function (e)
    {
        console.log('Unable to connect:' + e);
    });

});


So, what I'd really like is to pass the updated record through the notifyAllClientsOfChanges method into the code above and have it add the record to the WebGrid, or update it of it already exists.

I'm very new to this, so can anyone point me in the right direction? Any examples of doing this?

Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: WebGrid Update From SignalR Pin
Sander Rossel24-Mar-17 6:33
professionalSander Rossel24-Mar-17 6:33 
GeneralRe: WebGrid Update From SignalR Pin
Kevin Marois24-Apr-17 8:02
professionalKevin Marois24-Apr-17 8:02 
GeneralRe: WebGrid Update From SignalR Pin
Sander Rossel24-Apr-17 8:06
professionalSander Rossel24-Apr-17 8:06 
GeneralRe: WebGrid Update From SignalR Pin
Kevin Marois24-Apr-17 8:37
professionalKevin Marois24-Apr-17 8:37 
GeneralRe: WebGrid Update From SignalR Pin
Sander Rossel24-Apr-17 9:01
professionalSander Rossel24-Apr-17 9:01 
QuestionFaceBook Like Comment Box in asp.net Pin
Jay Parmar23-Mar-17 19:21
Jay Parmar23-Mar-17 19:21 
AnswerRe: FaceBook Like Comment Box in asp.net Pin
Richard MacCutchan23-Mar-17 22:56
mveRichard MacCutchan23-Mar-17 22:56 
AnswerRe: FaceBook Like Comment Box in asp.net Pin
User 418025429-Mar-17 5:19
User 418025429-Mar-17 5:19 
AnswerRe: FaceBook Like Comment Box in asp.net Pin
ZurdoDev29-Mar-17 6:01
professionalZurdoDev29-Mar-17 6:01 
QuestionThe server responded with a status of 404 Pin
Kevin Marois23-Mar-17 5:21
professionalKevin Marois23-Mar-17 5:21 
AnswerRe: The server responded with a status of 404 Pin
F-ES Sitecore23-Mar-17 23:32
professionalF-ES Sitecore23-Mar-17 23:32 
QuestionFront Page ideas? Pin
Member 1307776622-Mar-17 10:11
Member 1307776622-Mar-17 10:11 
QuestionRe: Front Page ideas? Pin
Richard MacCutchan22-Mar-17 10:45
mveRichard MacCutchan22-Mar-17 10:45 
AnswerRe: Front Page ideas? Pin
Nathan Minier23-Mar-17 1:18
professionalNathan Minier23-Mar-17 1:18 
Question[MODIFIED] - ASP.Net MVC - "A data source must be bound before this operation can be performed" Pin
Kevin Marois22-Mar-17 5:47
professionalKevin Marois22-Mar-17 5:47 
AnswerRe: [MODIFIED] - ASP.Net MVC - "A data source must be bound before this operation can be performed" Pin
Richard Deeming22-Mar-17 6:24
mveRichard Deeming22-Mar-17 6:24 
GeneralRe: [MODIFIED] - ASP.Net MVC - "A data source must be bound before this operation can be performed" Pin
Kevin Marois22-Mar-17 6:55
professionalKevin Marois22-Mar-17 6:55 

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.