locked
json inline editing not updating page and function shows as NULL RRS feed

  • Question

  • User692055318 posted

    Hello,

    I am using Mikes inline editing and I can't seem to modify it correctly. I can update the data and the edit and save options toggle back and forth but the page will not update unless I manually hit F5 and when I use firebug it says:

    TypeError: CallShift is null
     

    I'm sure its something silly, but I can't seem to find it.

     $(function () {
                    $('.edit-mode').hide();
                    $('.edit-shift').on('click', function () {
                        var tr = $(this).parents('tr:first');
                        tr.find('.edit-mode, .display-mode').toggle();
                    });
                    $('.save-shift').on('click', function () {
                        var tr = $(this).parents('tr:first');
                        var ID = $(this).prop('iD');
                        var rTOCId = tr.find('#RTOCId').val();
                        var pOCId = tr.find('#POCId').val();
                        var fTOCId = tr.find('#FTOCId').val();
                        var sTOCId = tr.find('#STOCId').val();
                        var aOCId = tr.find('#AOCId').val();
                        var sOS = tr.find('#StartOfShift').val();
                        var eOS = tr.find('#EndOfShift').val();
                        $.post(
                            '/EditShift',
                            { iD: ID, 
                              RTOCId: rTOCId, 
                              POCId: pOCId, 
                              FTOCId: fTOCId, 
                              STOCId: sTOCId, 
                              AOCId: aOCId },
                            function (CallShift) {
                                tr.find('#rTOCId').text(CallShift.RTOCId);
                                tr.find('#pOCId').text(CallShift.POCId);
                                tr.find('#fTOCId').text(CallShift.FTOCId);
                                tr.find('#sTOCId').text(CallShift.STOCId);
                                tr.find('#aOCId').text(CallShift.AOCId);
              
                            }, "json");
                        tr.find('.edit-mode, .display-mode').toggle();
                    });
                })

    Any thoughts would be great,

    Thanks

    Laura

    Wednesday, June 24, 2015 11:57 AM

Answers

  • User692055318 posted

    It seems to be showing the correct value, the value I changed it to.

    {"id":1,
    "StartOfShift":"\/Date(1434978000000)\/",
    "EndOfShift":"\/Date(1435582800000)\/",
    "RTOC":"Brent ",
    "RTOCId":19,
    "POC":"Noel ",
    "POCId":13,
    "FTOC":"Nate ",
    "FTOCId":8,
    "STOC":"James ",
    "STOCId":17,
    "AOC":"Ben ",
    "AOCId":2,
    "notes":null}

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 24, 2015 3:42 PM

All replies

  • User-821857111 posted

    Hit F12 in your browser (Chrome or IE) to bring up the developer tools and then watch the Network tab activity when you click Edit to save your changes. Check to see that the response is.

    Wednesday, June 24, 2015 3:34 PM
  • User692055318 posted

    It seems to be showing the correct value, the value I changed it to.

    {"id":1,
    "StartOfShift":"\/Date(1434978000000)\/",
    "EndOfShift":"\/Date(1435582800000)\/",
    "RTOC":"Brent ",
    "RTOCId":19,
    "POC":"Noel ",
    "POCId":13,
    "FTOC":"Nate ",
    "FTOCId":8,
    "STOC":"James ",
    "STOCId":17,
    "AOC":"Ben ",
    "AOCId":2,
    "notes":null}

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 24, 2015 3:42 PM