我应该在哪里编辑我的editablegrid js以匹配我的表与主键custID而不是id

I am using editablegrid from www.editablegrid.net and noticed that my grid works well as long my table hase column id which is primary key. When I use it on another table with custID as key it fails to update.

Where am I gooing wrong?

We can't help you much when you don't show us your code snippet. But let me do a wild guess. editablegrid is using the ID column by default. So you have to define the it if it there is no column named ID

the plugin got some default setting properties, you already played with those? Since the plugins does not have any documentation, nor does anything in the scripts says about defining a column as primary ID, i would advice you to move to a better documented datagrid like http://www.datatables.net/

var props = {
        name: "",
        label: "",
        editable: true,
        renderable: true,
        datatype: "string",
        unit: null,
        precision: -1, // means that all decimals are displayed
        nansymbol: '',
        decimal_point: ',',
        thousands_separator: '.',
        unit_before_number: false,
        bar: true, // is the column to be displayed in a bar chart ? relevant only for numerical columns 
        headerRenderer: null,
        headerEditor: null,
        cellRenderer: null,
        cellEditor: null,
        cellValidators: [],
        enumProvider: null,
        optionValues: null,
        columnIndex: -1
};

You should change this in many places

For delete Action in loaddata.php

$grid->addColumn('action', 'Action', 'html', NULL, false, 'id');

Change this to

$grid->addColumn('action', 'Action', 'html', NULL, false, 'yourprimarykey');

in update.php(Line no 39)

if ( $stmt = $mysqli->prepare("UPDATE ".$tablename." SET ".$colname." = ? WHERE id = ?")) {

Change this to

if ( $stmt = $mysqli->prepare("UPDATE ".$tablename." SET ".$colname." = ? WHERE yourprimarykey = ?")) {

in delete.php

if ( $stmt = $mysqli->prepare("DELETE FROM ".$tablename."  WHERE id = ?")) {

Change this to

if ( $stmt = $mysqli->prepare("DELETE FROM ".$tablename."  WHERE yourprimarykey = ?")) {