Need to change 'idProperty' used in grid
See original GitHub issueIssue Description
I use Slickgrid very powerfully.
I think many functions are working normally and are grid with good performance such as rendering speed.
But there’s one problem that’s been bothering me for a very long time.
The value of idProperty
used in the grid is id
.
https://github.com/6pac/SlickGrid/blob/f515b9b8cbafc23b0da9cde0705967158219687c/slick.dataview.js#L33
I don’t think it’s just me.
Let me give you an example that I use.

I’m using a grid in a kind of database tool and I’m using it to express the results of SQL.
I ran a very simple SQL(select "id", 1, 1, 1;
).

Reproduce situations where problems can occur.
SQL that can cause grid errors
select "id", 1, 1, 1
union
select "id", 2, 2, 2
union
select "id", 3, 3, 3

I have given a simple example, but I actually think that the primary key
of several tables can be ‘id’.
What I want to say here is simple.
Q1
. @6pac Is it possible to change the value of ‘idProperty’ to a value that will not overlap?
Currently, I am using the value by changing it directly. That made it difficult for me to use the plugins. Help me. 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Yep, agree with @ghiscoding, looks like
setItems
is the way to change theidProperty
. I don’t think a PR is needed, since you’re always going to be usingsetItems
at some point to initialise the data.use
setItems(dataset, objectIdProperty)
like shown in this line, that is when you create the DataView instance and you pass it the dataview. TheobjectIdProperty
is really how to override theid
and it’s optional, so if you don’t pass it, then it will useid
. So unless I misunderstood, that is the way to go