Display the ID values

Display the ID values

shuminliushuminliu Posts: 12Questions: 5Answers: 0

Hi,

I have a SQLServer table with 2 columns: ID (int, auto-inc), and Value (varchar 50). I'm trying to display both the ID and the Value in a table, but the ID column is always empty. Meanwhile the tr id is set correctly to row_1, row_2, etc. In the ajax API I did a trace and saw this in the response: the DT_RowId field has the value row_x, but the ID field is NULL. I'm wondering if ID is some keyword that is ignored. How would I get the ID back? Did I miss anything? I'm using the .NET 4.7 version of the DLL.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • shuminliushuminliu Posts: 12Questions: 5Answers: 0

    I forgot to mention that I'm using the Datatables Editor DLL. My test case is a simple trim down version of the staff example (down to two columns).

  • allanallan Posts: 63,180Questions: 1Answers: 10,411 Site admin
    Answer ✓

    Add:

    .Field( new Field('ID')->set(false) )
    

    to your list of fields (change the name of id column if you need to).

    The row_ prefix is used to:

    1. Make it a valid HTML4 id
    2. Try and prevent id clashes - you can change the prefix for each table using Editor.Prefix("...")

    Allan

This discussion has been closed.