<section class="content"> <div class="row"> <div class="box no-border"> <div class="box-body"> @(Html.EJ().Grid<JobCardRelatedPartViewModel>("partWarehouseGrid") .Datasource(ds => ds.URL(@Url.Action("GetActive", "PartIssueManagement")).Adaptor(AdaptorType.UrlAdaptor)) .AllowPaging() .AllowSorting() .AllowFiltering() .IsResponsive(true) //.MinWidth(600) .AllowScrolling(true) .ScrollSettings(scroll => { scroll.EnableTouchScroll(true); }) .ToolbarSettings(toolbar => { if (User.IsInRole("Admin") || User.IsInRole("WarehouseManager")) { toolbar.ShowToolbar().CustomToolbarItems(new List<object> { new CustomToolbarItem {TemplateID = "#EditTemplate" , Text = "Issue Part"}, new CustomToolbarItem {TemplateID = "#UpdateTemplate" ,Text = "Update Issue"}, new CustomToolbarItem() {TemplateID = "#refreshTemplate", Text = "Refresh"} // new CustomToolbarItem() {TemplateID = "#PdfGenerateTemplate"} }); } }) .EditSettings(edit => { edit.AllowEditOnDblClick(false); }) .ClientSideEvents(evt => { evt.ActionFailure("toolbarClickEvent.failureMessage"); evt.ToolbarClick("toolbarClickEvent.onClickToolbar"); evt.ActionBegin("gridActionEvent.onBegin"); evt.ActionComplete("gridActionEvent.onComplete"); }) .Columns(col => { col.Field(p => p.Id).Visible(false).IsPrimaryKey(true).Add(); col.Field(p => p.JobCardNo).HeaderText("Job Card No").Add(); col.Field(p => p.PartId).DataSource(x => x.URL(Url.Action("GetAllPartForDropDown", "Part"))).ForeignKeyField("Id").ForeignKeyValue("PartCode").HeaderText("Part Code").AllowSorting(true).AllowFiltering(true).Add(); col.Field(p => p.NoOfUnit).HeaderText("Quantity").AllowFiltering(false).Add(); col.Field(p => p.UpdatedBy).DataSource(x => x.URL(Url.Action("GetAllUser", "UserManagement"))).ForeignKeyField("Id").ForeignKeyValue("FullName").HeaderText("Requested by").TextAlign(TextAlign.Left).Add(); col.Field(p => p.UpdatedDateDisplay).HeaderText("Requested date").TextAlign(TextAlign.Left).Add(); col.Field(p => p.Part.PartName).HeaderText("Part Name").TextAlign(TextAlign.Left).AllowFiltering(false).Add(); col.Field(p => p.IssuedBy).DataSource(x => x.URL(Url.Action("GetAllUser", "UserManagement"))).ForeignKeyField("Id").ForeignKeyValue("FullName").HeaderText("Issued by").Add(); col.Field(p => p.IssuedDateDisplay).Format("{0:dd/MM/yyyy}").HeaderText("Issued Date").Add(); col.Field(p => p.WarehouseStatus).HeaderText("Status").Template("#statusTemplate").Add(); })) </div> <div class="overlay hidden"> <i class="fa fa-spinner fa-spin"></i> </div> </div> </div> </section>
@(Html.EJ().Grid<JobCardViewModel>("jobCardGrid") .Datasource(ds => ds.URL(@Url.Action("GetActive", "JobCard")).Adaptor(AdaptorType.UrlAdaptor)) .AllowPaging() .AllowSorting() .AllowFiltering() .IsResponsive(true) .MinWidth(600) .ScrollSettings(sc => sc.Height("100%").Width("100%")) .AllowScrolling(true) .ToolbarSettings(toolbar => { toolbar.ShowToolbar().CustomToolbarItems(new List<object> { new CustomToolbarItem {TemplateID = "#AddTemplate", Text = "Create Jjob card "}, new CustomToolbarItem {TemplateID = "#EditTemplate", Text = "Update job card"}, new CustomToolbarItem {TemplateID = "#PdfGenerateTemplate", Text = "Generate PDF"}, new CustomToolbarItem {TemplateID = "#refreshTemplate", Text = "Refresh"} }); }) .EditSettings(edit => { if (User.IsInRole("Admin") || User.IsInRole("TechnicianManager")) { edit.AllowDeleting().AllowEditing().AllowEditOnDblClick(false).EditMode(EditMode.DialogTemplate).DialogEditorTemplateID("#editerTemplate"); } }) .ClientSideEvents(evt => { evt.ActionFailure("crudManagementEvent.failureMessage"); evt.ActionBegin("gridActionEvent.onBegin"); evt.ActionComplete("gridActionEvent.onComplete"); evt.ToolbarClick("crudManagementEvent.onClickToolbar"); }) .Columns(col => { col.Field(p => p.Id).Visible(false).IsPrimaryKey(true).Add(); col.Field(p => p.JobCardNo).HeaderText("Job Card No").TextAlign(TextAlign.Left).AllowSorting(true).Add(); col.Field(p => p.DisplaySriNo).HeaderText("SRI No").TextAlign(TextAlign.Left).AllowSorting(true).AllowFiltering(true).Add(); col.Field(p => p.CustomerFullName).HeaderText("Customer Name").TextAlign(TextAlign.Left).Add(); col.Field(p => p.FullAmount).HeaderText("Repair Chargers").Format("{0:c2}").TextAlign(TextAlign.Left).AllowFiltering(false).Add(); col.Field(p => p.TechnicianAssignedObj.FirstName).HeaderText("Technician Assigned").TextAlign(TextAlign.Left).Add(); col.Field(p => p.Status).HeaderText("Status").Template("#statusTemplate").Add(); }))