Sithelo Ngwenya Sithelo Ngwenya - 7 months ago 21
PHP Question

Where should I edit my editablegrid js to match my table with primary key custID not 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?

Answer

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
};