This is a migrated thread and some comments may be shown as answers.

Model Id with multiple columns instead of one.

1 Answer 1648 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 19 Jul 2019, 02:25 PM

Hello,

Is there a way to use a multiple column or composite key of a table within the schema model?

Something like this:

                    schema: {
                        model: {
                            id: "COMPONENT_CONFIG_ID", "PARENT_CONFIG_ID", "USE_DT",
                            fields: {

 

Thanks,

Steven

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 23 Jul 2019, 10:29 AM
Hi Steven,

I have noticed that the same question was initiated in our private Support system. It is recommended to avoid submitting duplicate tickets as this would lead to a tidier and more easily navigatable history. However, I am pasting my response below in case anyone from the community face the same scenario:

The Kendo UI DataSource does not support composite keys for the Id field. Generally, in the context of the data source, it mainly uses the Id to determine whether the item is new or is updated. Therefore, an indicator whether it should be send a CREATE or UPDATE request.

What I can recommend is to set only one field to be the Id of the data source. Overall, this would sort of play the role of a pseudo id. You would be sending the whole model to the remote endpoint whatsoever. In the handler there, you would update it according to your preferences. 

This functionality has already been requested and discussed in our Feedback Portal. You can leave your vote so that the item would gain a higher priority:

https://feedback.telerik.com/kendo-jquery-ui/1358261-support-composite-keys-in-the-datasource-id-property


Regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Data Source
Asked by
Steven
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or