Issue with columns that have a relationship

I am testing out the functionality of the HTML grid control. I have the grid up and running but am having an issue. I have 2 tables, Accounts and Orders. The order table has a relationship to the Account table. I cannot seem to select and Account when entering an order into the grid, it simply acts like a text box. I would have assumed it would be an autocomplete drop down like the Silverlight client. If I use another screen to enter the data when I view the orders grid the Account column shows "object" instead of the Account Name like "Acme Inc.". I have the Summary value set correctly and if I use the built in table view it shows correctly. Any assistance would be great.

Thanks,

Josh

1 Reply

AS Alan Sangeeth S Syncfusion Team May 15, 2015 12:23 PM UTC

Hi Josh,

Thanks for using Syncfusion products.

We suspect that your requirement is “Dropdown type editing on Foreign table field” and so wee have created a sample based on this and the same can be downloaded from below link.

Sample: http://www.syncfusion.com/downloads/support/forum/119147/GridLightSwitch1585561765.zip

In the above sample we have set foreign table field values to a column using “dataSource” Grid Column property and mapped the field using “foreignKeyField” and “foreignKeyValue”. Please refer the following code snippets.

var data = contentItem.application.rootUri + "/NORTHWNDEntitiesData.svc/Employees/?$top=45";

$.getJSON(data).done(function(e){

//Rendering the Grid Control

itemTemplate.ejGrid(

{

..

columns: [

{ field: "OrderID", isPrimaryKey: true, width: 80 },

{ field: "EmployeeID", width: 80, foreignKeyField: "EmployeeID", foreignKeyValue: "FirstName", dataSource: e.value, editType: ej.Grid.EditingType.Dropdown, width: 75, headerText: "FirstName" },

]

});

})



If we misunderstood your requirement then please get back to us with clear information so that we could provide you a response as early as possible.

Please let us know if you need any further assistance.

Regards,
Alan Sangeeth S

Loader.
Up arrow icon