Primary Key

Primary Key

montoyammontoyam Posts: 568Questions: 136Answers: 5

I see that if your table's primary key is not called 'id' that you need to specify the name of the primary key. The example given is: let editor = new Editor( db, 'staff', 'staffId' );

However, in the .NET sample code the format of initializing the editor is:

    editor = new $.fn.dataTable.Editor( {
        ajax: '/api/projectSetup',
        table: '#ProjectSetup',
        fields: [ {
                label: 'Project ID:',
                name:  'ProjectID'
            }, {
                label: 'Fund/Org:',
                name:  'FundOrg'
            }, {
                label: 'Billing Method:',
                name:  'BillingMethodID',
            }
        ]
    } );

How do I identify the primary key in this format?

Answers

  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    Sorry, I figured out that it needed to be in the controller, not the html

    var response = new Editor(db, "ProjectSetup", "ProjectSetupID")

This discussion has been closed.