Edit window does not show data values

Edit window does not show data values

e8416o8e8416o8 Posts: 25Questions: 9Answers: 1

When clicking Edit button after highlight a row, "1 row selected" message shows.
This tells me that the event was recognized.
But the selected row data are not shown on the window.

Here is the link to my site:
172.17.11.36:8080/myPayers/index.jsp

Thanks

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Hi,

    Thanks for the link. I'm afraid I'm travelling at the moment so can't debug it on my phone, but will take a look at your page when I get back.

    Allan

  • e8416o8e8416o8 Posts: 25Questions: 9Answers: 1

    Thanks for the quick reply.

    Karen

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Hi,

    I've just tried to load it up, but it looks like the server might be offline at the moment. I'm not getting any connection from the above address.

    Thanks,
    Allan

  • e8416o8e8416o8 Posts: 25Questions: 9Answers: 1

    Sorry.
    Could you try it with
    http://172.17.4.227:8080/myPayers/index.jsp?

  • e8416o8e8416o8 Posts: 25Questions: 9Answers: 1

    if you can't access to it, here is the code snippet:

    var editor; // use a global for the submit and return data rendering in the examples
      
    $(document).ready(function() {
        editor = new $.fn.dataTable.Editor( {
            serverSide: true,
            ajax: '/myPayers/DataTableServlet',
            table: '#payers',
            idSrc:  0,
     
            fields: [ {
                    label: "PUID:",
                    name:  "id"
                }, {
                    label: "Payer ID:",
                    name:  "payerID"
                }, {
                    label: "Payer Name:",
                    name:  "payerName"
                }, {
                    label: "Rate Schedule:",
                    name:  "rateSchedule"
                }, {
                    label: "Ins Co:",
                    name:  "insCo",
                }, {
                    label: "Ins Type:",
                    name: "insType",
                }, {
                    label: "Ins Group ID:",
                    name: "groupID",
                }, {
                    label: "Effective:",
                    name: "eff",
                    type: "date"
                }, {
                    label: "Termination:",
                    name: "term",
                    type: "date"
                }
            ]
        } );
     
        // New record
        $('.b_create').on('click', function (e) {
            e.preventDefault();
            alert("Create");
             
            editor.create( {
                title: 'Create new record',
                buttons: 'Add'
            } );
        } );
      
        // Edit record
        $(".b_edit").click(function(e)  {
            e.preventDefault();
            alert("Edit");
            editor.edit( $(this).closest('tr'), {
                title: 'Edit record',
                buttons: 'Update'
            } );
        } );
      
        // Delete a record
        $(".b_delete").click(function(e)  {
            e.preventDefault();
            alert("Delete");
      
            editor.remove( $(this).closest('tr'), {
                title: 'Delete record',
                message: 'Are you sure you wish to remove this record?',
                buttons: 'Delete'
            } );
        } );
         
        $('#payers').DataTable( {
             
            dom: 'Bfrtip',
            type: 'POST',
            bServerSide: true,
            sAjaxSource: '/myPayers/DataTableServlet',
            idSrc:  0,
            bProcessing: true,
            spagingType: 'full_numbers',
            bJQueryUI: true,
     
            columns: [
                       
                { data: 0, "sortable": false, "visible": false},  // PyrContractUID
                { data: 1},   // payerID
                { data: 2},   // payerName
                { data: 3},   // rateSchedule
                { data: 4},   // insCo
                { data: 5},   // insType
                { data: 6},   //  groupID
                { data: 7},   //  eff
                { data: 8}    //  term
            ],
             
            columnDefs: [
                         { "targets": "rateSchedule", 
                           "defaultContent": "",
                         },
                         { "targets": "insCo", 
                             "defaultContent": "",
                           },
                         { "targets": "insType",
                             "defaultContent": "",
                         },
                         { "targets": "groupID",
                             "defaultContent": "",
                         }
            ],                    
     
            select: true,
            buttons: [
                { extend: "create", editor: editor },
                { extend: "edit",   editor: editor },
                { extend: "remove", editor: editor }
            ],
        });
         
         
       
       
    /*   
        editor.on('initEdit', function(e, json, data) {
            var modifier = editor.modifier();  // Gets the selected row of the table
            if ( modifier ) {
                // Get data for this row
                var table = $('#payers').DataTable();
                var data = table.row( modifier ).data();
                editor.show(); //Shows all fields
                console.log( modifier );
                console.log( data );
                alert( 'initEdit' );
            }
     
        });
         
        editor.on( 'edit', function ( e, json, data ) {
            alert( 'Edit requested' );
            var modifier = editor.modifier();  // Gets the selected row of the table
            if ( modifier ) {
                // Get data for this row
                var data = table.row( modifier ).data();
                console.log( data );
                alert( 'Edit requested' );
            }
        } );
    */       
    } );
    
    
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Thanks for the update. I'm travelling at the moment I'm afraid, but I'll take a dig into this when I get back on Tuesday and hopefully be able to access the server then.

    Allan

  • e8416o8e8416o8 Posts: 25Questions: 9Answers: 1

    Allan,

    I got it working. Thank you for the offer to look into it.

    Karen

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Hi Karen,

    Thanks for posting back - great to hear you've got it working now!

    Allan

This discussion has been closed.