We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid: Filtering column with foreign key

Adding filtering to the foreign key example for ejGrid results in a list of numbers (employeeIds) for the First Name filter.
What would be the best way to get the names to show up in the list instead of numbers?
Added the changed sample file as an attachment to this post also.

$(function () {

// the datasource "window.gridData" is referred from jsondata.min.js

var data = window.gridData;

$("#Grid").ejGrid({

dataSource: data,

allowPaging: true,

allowSorting: true,

allowGrouping: true,

allowMultiSorting: true,

allowFiltering: true,

enableHeaderHover: false,

allowResizing: true,

filterSettings: { filterType: "excel" },

editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, editMode: "normal" },

toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update,ej.Grid.ToolBarItems.Cancel] },

columns: [

{ field: "OrderID", width: 80, isPrimaryKey: true,textAlign: ej.TextAlign.Right,validationRules: {required:true, number: true }} ,

{ field: "EmployeeID", foreignKeyField: "EmployeeID", foreignKeyValue: "FirstName", dataSource: window.employeeView, width: 75, headerText: "First Name" },

{ field: "Freight", textAlign: ej.TextAlign.Right, width: 75, editType: ej.Grid.EditingType.Numeric,editParams: { decimalPlaces: 2 }, validationRules: { range: [0, 1000] }, format: "{0:C}" },

{ field: "ShipName", headerText: 'Ship Name', width: 150 },

{ field: "ShipCountry", headerText: 'Ship Country', editType: ej.Grid.EditingType.Dropdown, width: 90 }

]

});

});


Attachment: ForeignKey2_1101d625.zip

7 Replies

BM Balaji Marimuthu Syncfusion Team May 29, 2015 09:48 AM UTC

Hi Jimmy,

Thank you using Syncfusion products.

We have considered this requirement “Excel filter in foreign key column displayed parent table values” as a usability issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

We suggest you to use Menu filter until we will fix the issue in Excel filter type.

Please let us know if you have any queries.

Regards,
Balaji Marimuthu


CS Cristiano Souza Silva October 14, 2015 02:07 PM UTC

I've same problem here. When it will be available ?

Thank you.


BM Balaji Marimuthu Syncfusion Team October 15, 2015 08:24 AM UTC

Hi Jimmy,

We have already fixed the mentioned issue “Excel filter in foreign key column displayed parent table values” in version 13.2.0.29. So we suggest you to upgrade to the latest version and is available for download under the following link.

https://www.syncfusion.com/forums/120659/essential-studio-2015-volume-3-final-release-v13-3-0-7-is-available-for-download


We have created a sample and checked the mentioned issue in latest version, the Excel filter shows the FirstName value in foreignkey column correctly. Still if you face the same issue please revert us the sample and share the screen shot to reproduce issue from our end.

http://jsplayground.syncfusion.com/3oalhufo


Regards,
Balaji Marimuthu



CS Cristiano Souza Silva October 15, 2015 05:09 PM UTC

Hello Balaji,

I'm using a Syncfusion version 13.3.0.7. When a click on filter, happen a javascript error. 
Some prints attached.

I'm using MVC Controller with knockout.

Thank you.

Attachment: prints_b56cf68d.zip


BM Balaji Marimuthu Syncfusion Team October 16, 2015 12:27 PM UTC

Hi Jimmy,


We have already fixed the reported issue “Excel filtering is not working in foreign key columns with different field and foreignKeyField name” and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents 

Regards,
Balaji Marimuthu



CS Cristiano Souza Silva October 20, 2015 10:05 PM UTC

Hi,

I didn't see this report on my incidents list.


Thank you.


KK K Kalai Selvi Syncfusion Team October 21, 2015 04:42 AM UTC

Hi Cristiano,
 
We are sorry for the inconvenience.
 
A new support incident has been created for the issue "Excel filtering is not working in foreign key columns with different field and foreignKeyField name" under your account and please log on to our support website to check for further updates. 
 
Regards,
Kalaiselvi

Loader.
Live Chat Icon For mobile
Up arrow icon