jQuery UI Widgets › Forums › Grid › Entities with composite primary keys
Tagged: composite primary key, database, foreign key, grid, jqxgrid, jqxTreeGrid, relation, relational, table, tree grid
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 10 years, 10 months ago.
-
Author
-
I
Some one can tell me if the Grid/Tree Grid support entities with composite primary keys?
If so, can you show me how do that?
Thanks
RegardsHello slbtuga,
jqxGrid and jqxTreeGrid load the data passed to them through the jqxDataAdapter plug-in. The actual relations of tables in the database is of no concern to the widgets, except if you wish to have a “foreign key” column, as in the following demo: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/foreignkeycolumn.htm?arctic.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I was thinking about update and delete in server side.
When the Grid call server (in my case asp.net mvc) for deletion/update, only send one id about the row in question specified by “id” property defined in source of dataAdapter, right?
How I delete/update some entity if have more than one primary key?Regards.
Hi slbtuga,
The grid can send other data apart from the id, too. In fact, when updating a row you will need to send all its data to the server. This can be done for the delete operation, too. You can then use the row data however you like on your server-side. Here is a part of the Build CRUD Web App with jqxGrid using PHP and MySQL example that shows how to send the complete row data to the server when a row is updated:
updaterow: function(rowid, rowdata, commit) { // synchronize with the server - send update command var data = "update=true&" + $.param(rowdata); $.ajax({ dataType: 'json', url: 'data.php', cache: false, data: data, success: function(data, status, xhr) { // update command is executed. commit(true); }, error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); }Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.