BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
$(function () { var dataManager = ej.DataManager({ url: "@(AppSettings.Value.BaseDataUrl)/odata/Vassoi", adaptor: new ej.ODataV4Adaptor() }); $("#Grid").ejGrid({ dataSource: dataManager, allowPaging: true, toolbarSettings: { showToolbar: true, //toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] }, editSettings: { allowEditing: true, allowAdding: true }, allowFiltering: true, allowSorting: true, showColumnChooser: true, allowScrolling: true, scrollSettings: { width: "auto" }, locale: "it-IT", scrollSettings: { width: "30%" }, columns: [ { field: "IdVassoio", headerText: "Id", isPrimaryKey: true, isIdentity: true, type: "number", textAlign: "right", headerTextAlign: "right", width: 80, visible: false }, { field: "Codice", headerText: "Codice", type: "string", allowEditing: true, width:150 }, { field: "TassoScarto", headerText: "Tasso Scarto", type: "number", allowEditing: true, allowFiltering:false, width:100 }, { field: "GiacenzaMinima", headerText: "Giacenza Minima", type: "number", allowEditing: true, width: 120, allowFiltering:false }, ], actionBegin: function (args) { switch (args.requestType) { case "filtering": if (args.currentFilterObject[0].operator == "startswith") args.currentFilterObject[0].operator = "contains"; break; } } }); });
$("#DetailGrid").ejGrid({
dataSource: null,
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: ej.DataManager(window.gridData).executeLocal(ej.Query().take(10)),
isResponsive: true,
allowPaging: false,
columns: [
{ field: "EmployeeID", headerText: "Employee ID", textAlign: ej.TextAlign.Right, width: 125 },
{
field: "EmployeeID", width: 90, foreignKeyField: "EmployeeID", foreignKeyValue: "FirstName", dataSource: ej.DataManager({
url: "http://services.odata.org/V4/Northwind/Northwind.svc/Employees",
adaptor: new ej.ODataV4Adaptor()
}), headerText: "First Name"//foreignkeycolumn
},
{ field: "Freight", headerText: "Freight", textAlign: ej.TextAlign.Right, width: 100, format: "{0:C}", priority: 2 },
{ field: "ShipCity", headerText: "Ship City", width: 150, priority: 3 },
{ field: "OrderDate", headerText: "Order Date", width: 100, textAlign: ej.TextAlign.Right, format: "{0:MM/dd/yyyy}", priority: 4 },
{ field: "ShipCountry", headerText: "Ship Country", width: 100, priority: 4 }
]
|