Hello,
We are trying to use the igGrid to edit records that do not necessarily have a visible primaryKey column. At first we tried to used a hidden column by setting the column property hidden: true, but it causes the data to shift one column to the left as seen in the screen shot below.
Notice that the checkbox selector is no longer visible and the data for the ID column is in the checkbox column.
To get around this I gave the primary key column a width of 0px, header of "", and removed the hidden: true property. This works fine except when we enter edit mode the row being edited displays a new column and is shifted to the left as seen in the following screen shot.
We are using version 11.2.20112.1023 of the jQuery controls.
Thanks,Joshua
Hi,
I'm using Version 13.2.20132.1010, and the grid is not rendering any records when I set the primary key column as hidden.
I've set the data type of the pk column.
The grid does not render any rows unless the PK colums is visible.
Any ideas?
Thanks for reply Martin,
the reason i asked is because the grid is used in an application that allows users to show different kind of data. The user is also able to pick the column he wants to see, and he may not necessarily use the column that is used to identify the datarecord.
So i'll stay with the solution of always adding the column to grid (hidden, if not selected by user).
Regards
Lorenz
Hello Lorenz Hrobarsch,
This is by design. The igGridUpdating requires igGrid.options.primaryKey to be defined and the primary key field to be in the grid's column collection in order to work. The reason is that we need the primary key data type in order to look-up the correct record in the data source. Note: localSchemaTransform option doesn't affect this behavior.
Is there a particular reason why you don't want to use hidden primary key column?
Best regards,Martin PavlovInfragistics, Inc.
i'm encountering a problem similar to this. When i'll build a grid without the primarykey (only show other columns), i'm unable to identify rows in the rowSelectionChanged-event. The "Id"-property is then always undefined. Adding the column as a hidden column works, but i'd like to avoid this workaround.
Am i doing something wrong or is this a bug/"as designed" ?
edit: Found the "localSchemaTransform"-option. Now i get the primarykey on the selection event, but when trying to update the grid by double clicking a cell, it says no primary key defined...
(I'm on latest version)
Lorenz Hrobarsch
Hi joshua 82,
Attached you can find your working sample. I've made several changes to the grid configuration which you can see by searching for "changed" and "added" comments in code.
The changes are:
1.I've changed the grid width to absolute size. (This is needed in order next change to work.)
2.I've changed "_deleteID" column to be visible with 0px width and no headerText.
I think the biggest annoyance in the workaround is the width of the grid which should be in absolute size. If this doesn't suit you, you have to wait until 12.1 version is out.
Hope this helps,
Martin Pavlov
Infragistics, Inc.