Click here to Skip to main content
15,892,072 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Quick JavaScript Question Pin
Richard Deeming25-Apr-17 6:59
mveRichard Deeming25-Apr-17 6:59 
GeneralRe: Quick JavaScript Question Pin
Kevin Marois25-Apr-17 7:09
professionalKevin Marois25-Apr-17 7:09 
GeneralRe: Quick JavaScript Question Pin
Kevin Marois25-Apr-17 7:16
professionalKevin Marois25-Apr-17 7:16 
GeneralRe: Quick JavaScript Question Pin
Richard Deeming25-Apr-17 8:10
mveRichard Deeming25-Apr-17 8:10 
GeneralRe: Quick JavaScript Question Pin
Kevin Marois25-Apr-17 8:11
professionalKevin Marois25-Apr-17 8:11 
GeneralRe: Quick JavaScript Question Pin
Richard Deeming25-Apr-17 8:15
mveRichard Deeming25-Apr-17 8:15 
GeneralRe: Quick JavaScript Question Pin
Kevin Marois25-Apr-17 8:19
professionalKevin Marois25-Apr-17 8:19 
QuestionAdd or Update Row In Data Table Pin
Kevin Marois24-Apr-17 12:13
professionalKevin Marois24-Apr-17 12:13 
I have this data table:
@using (@Html.BeginForm("Index", "Home"))
{
    <div id="divData">
        @{
            var grid = new WebGrid(Model, rowsPerPage: 20);

<pre>
        @grid.GetHtml(
        tableStyle: "webgrid-table",
        headerStyle: "webgrid-header",
        footerStyle: "webgrid-footer",
        alternatingRowStyle: "webgrid-alternating-row",
        selectedRowStyle: "webgrid-selected-row",
        rowStyle: "webgrid-row-style",
        mode: WebGridPagerModes.All,
        columns:
        grid.Columns
        (
            grid.Column(columnName: "RowId", header: "Row Id", format: @<text>@item.RowId</text>),
            grid.Column(columnName: "SiteId", header: "Site Id", format: @<text>@item.SiteId</text>),
        ))

        //other columns ommitted
    }


}


I then listen to a SignalR service for new or updated row data. My javaScript code
@section scripts
{
    <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 () {

               $(function () {

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

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

                        console.log("notifyAllClientsOfChanges received");

                        //Here I want to either Add or Update the row who's Id matches the Model's id.

                        // 1) See if the row exists in the table

                        // 2) If the row exists, update it from the model passed in

                        // 3) If the row does not exist, add it

                    });
                });
    </script>
}

Could use some help here.

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


modified 25-Apr-17 18:29pm.

AnswerRe: Add or Update Row In Data Table Pin
Richard Deeming25-Apr-17 12:48
mveRichard Deeming25-Apr-17 12:48 
GeneralRe: Add or Update Row In Data Table Pin
Kevin Marois25-Apr-17 12:49
professionalKevin Marois25-Apr-17 12:49 
GeneralRe: Add or Update Row In Data Table Pin
Kevin Marois26-Apr-17 8:01
professionalKevin Marois26-Apr-17 8:01 
GeneralRe: Add or Update Row In Data Table Pin
Richard Deeming27-Apr-17 1:39
mveRichard Deeming27-Apr-17 1:39 
GeneralRe: Add or Update Row In Data Table Pin
Kevin Marois28-Apr-17 7:21
professionalKevin Marois28-Apr-17 7:21 
GeneralRe: Add or Update Row In Data Table Pin
Richard Deeming28-Apr-17 8:27
mveRichard Deeming28-Apr-17 8:27 
GeneralRe: Add or Update Row In Data Table Pin
Kevin Marois1-May-17 6:55
professionalKevin Marois1-May-17 6:55 
GeneralRe: Add or Update Row In Data Table Pin
Richard Deeming3-May-17 9:51
mveRichard Deeming3-May-17 9:51 
GeneralRe: Add or Update Row In Data Table Pin
Kevin Marois3-May-17 10:35
professionalKevin Marois3-May-17 10:35 
GeneralRe: Add or Update Row In Data Table Pin
Kevin Marois3-May-17 10:37
professionalKevin Marois3-May-17 10:37 
QuestionMSChart load at Runtime raise error NullReferenceException System.Web.UI.DataVisualization.Charting.Axis.Resize Pin
lamiaa_moh23-Apr-17 2:06
lamiaa_moh23-Apr-17 2:06 
AnswerRe: MSChart load at Runtime raise error NullReferenceException System.Web.UI.DataVisualization.Charting.Axis.Resize Pin
Afzaal Ahmad Zeeshan23-Apr-17 2:33
professionalAfzaal Ahmad Zeeshan23-Apr-17 2:33 
Questionapprendre à coder facilement Pin
Member 1312801214-Apr-17 0:51
Member 1312801214-Apr-17 0:51 
AnswerRe: apprendre à coder facilement Pin
User 418025416-Apr-17 16:46
User 418025416-Apr-17 16:46 
Questioncookies not storing in login page why???showing NO cookies found Pin
LOKENDRA YADAV7-Apr-17 20:19
LOKENDRA YADAV7-Apr-17 20:19 
AnswerRe: cookies not storing in login page why???showing NO cookies found Pin
Richard Deeming10-Apr-17 7:41
mveRichard Deeming10-Apr-17 7:41 
QuestionShould i use bootstrap for my project? Pin
Member 131100775-Apr-17 23:37
Member 131100775-Apr-17 23:37 

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.