Good morning.
Please, can you change my sample ( http://jsplayground.syncfusion.com/2u2nonot ) in order to know how to do it?
I will be awaiting for your reply, thanks in advance.
Regards, Luis Carlos.
|
<script type="text/javascript">
var Source = [{ EmployeeID: 1, FirstName: "Anna" },
{ EmployeeID: 2, FirstName: "John" },
{ EmployeeID: 3, FirstName: "Vanessa" },
{ EmployeeID: 4, FirstName: "Kent" },
{ EmployeeID: 5, FirstName: "Grayson" },
{ EmployeeID: 6, FirstName: "Africa" },
{ EmployeeID: 7, FirstName: "Carlson" },
{ EmployeeID: 8, FirstName: "Barbara" },
{ EmployeeID: 9, FirstName: "Kelsey" }]
$(function () {
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
commonWidth: 120,
allowPaging: true,
allowSearching: true,
load: "onLoad",
columns: [
{ field: "EmployeeID_FirstName", width: 75, headerText: "First Name" },
{ field: "ShipCity", headerText: "Ship City" },
{ field: "Verified", headerText: "Verified" }
],
});
$("#Searching").ejButton({
size: "small",
click: "onSearching",
});
});
function onSearching(args) {
var gridObj = $("#Grid").ejGrid("instance");
var val = $("#serachval").val();
gridObj.search(val);
}
var foreignObj = [
{
dataSource: Source,
foreignKeyField: "EmployeeID", //Property in the Grid's main dataSource
field: "EmployeeID", //Property in foreignkey dataSource
foreignKeyValue: "FirstName" //Property in foreignkey dataSource
}
];
function onLoad(args) {
this.model.dataSource.adaptor = new ej.ForeignKeyAdaptor(foreignObj, "remoteSaveAdaptor");
}
</script> |
|
|