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 joshua82,
The first issue you are experiencing is because "RowSelectors" feature is enabled along with "Updating" feature. The problem is fixed in our next version which will be available very soon.
I was unable to reproduce the problem which you are experiencing in your workaround. I've attached my sample. Please review it and see if it can help you.
If it is not a problem you can post your igGrid initialization code for me to investigate.
Best regards,
Martin Pavlov
Infragistics Inc.
Thanks Martin,
I am attaching code to this post I modified your example to load our data.
What you see is a results var that contains a sample of the json being returned from the server. This json contains the schema, columns, data, and grid features because the grid never has static columns and can be modifed at anytime by an administrator. The grid is initialized after this data has been sent to the client.
The column _deleteID is the primary key and might be the same as objectID, and _objectID it is the only column that is 100% unique. You will see a column called UniqueKey this is actually a sequence number generated by the server but does not represent the row data.
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,
Infragistics, Inc.