question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Name of the primary key is not id

See original GitHub issue

Ajax result if the primary key is not “id”(lowercase) cannot choose example

[
    {
        "Id":1,
        "UserName":"jay1",
        "Age":"18"
    },{
        "Id":2,
        "UserName":"jay2",
        "Age":"18"
    },{
        "Id":3,
        "UserName":"jay3",
        "Age":"18"
    },{
        "Id":4,
        "UserName":"jay4",
        "Age":"18"
    },{
        "Id":5,
        "UserName":"jay5",
        "Age":"18"
    }
]

Just like the above example, if does not contain the attribute “id”(lowercase), select2 will not be able to work, how do I custom primary keys, or when there is no attribute “id” how to make select2 work normally

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yedajiang44commented, Sep 19, 2018

@pedrofurtado That’s great!Very looking forward to

0reactions
yedajiang44commented, Nov 10, 2018

@pedrofurtado hey guy.Has this program been adopted?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is naming a table's Primary Key column “Id ... - Quora
Naming a table's primary key column by “id” is not a bad practice, but a database can have many tables, naming all of...
Read more >
Why is naming a table's Primary Key column "Id" considered ...
The Id column is special; it is the primary key. Any table can have any number of foreign keys, but it can have...
Read more >
Is it better to name the primary key column id or *_id?
I always use the verbose form (i.e. 'employee_id' rather than 'id') as it is more descriptive. If you are joining more than one...
Read more >
Add or change a table's primary key in Access
A primary key is a field or set of fields with values that are unique throughout a table. Values of the key can...
Read more >
The Ultimate Guide To Primary Key - SQLite Tutorial
This tutorial shows you how to use SQLite PRIMARY KEY constraint to ... CREATE TABLE countries ( country_id INTEGER PRIMARY KEY, name TEXT...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found