jQWidgets Forums
jQuery UI Widgets › Forums › Grid › asp.net tag helpers grid primary key with 2 fields
This topic contains 2 replies, has 2 voices, and was last updated by rubenfernande3 8 years, 7 months ago.
-
Author
-
I´m testing the asp.net tag helpers for asp.net core.
I´ve got a grid that consume data from a table that hasa primary key composed with 2 fields. I don´t know how to send both fields when i delete a row.
My key is codCeco and Planta. I don´t know how to put both with the tags. I think i can make the same passing parameters to url.action and using hidden parameters but it would be cleaner doing it with the tags.
Here is the code: (I don´t know how to put the source-id to receive both fields).
<jqx-grid id=”grid” autorowheight=”true” filterable=”true” instance=”gridInstance()” autoshowfiltericon=”true” theme=”energyblue” editmode=”selectedcell” editable=”true” create=”@Url.Action(“Add”,”Cecos”)” delete=”@Url.Action(“Delete”,”Cecos”)” edit=”@Url.Action(“Edit”,”Cecos”)” pageable=”true” pagesize=”10″ sortable=”true” width=”100%” source=”Model”>
<jqx-grid-columns>
<jqx-grid-column pinned=”true” editable=”false” datafield-for=”@ceco.CodCeCo” text=”Centro Coste”></jqx-grid-column>
<jqx-grid-column pinned=”true” editable=”false” datafield-for=”@ceco.Planta” text=”Planta”></jqx-grid-column>
<jqx-grid-column datafield-for=”@ceco.DesCeCo” text=”Descripción del centro de coste”></jqx-grid-column>
</jqx-grid-columns>
</jqx-grid>Any advice?
Hi rubenfernande3,
The source-id can contain only one field. It cannot have display and data fields.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/i have been working on this…
I dont find a a clean solution to send more than one field to the server with the grid tag helpers.
I´m trying to use your aproach to make a crud grid but i need to send 2 fields to the server because the primary key of the database table has 2 fields.Im unable to make the delete operation working.
If i cant put more than one field in the source-id how can i send more parameters to the server so my controller can get them and find the entity that has to delete.I have tried diferent solutions but none of them are clean.
Do you have an example to manage crud operations with grid tag helpers when the id of the model has a composite primary key?.
Thanx in advance.
-
AuthorPosts
You must be logged in to reply to this topic.