二、创建_ViewDemoObjectModal分部视图:
@using EDU.SIS.Web.Areas.app.Models.Common.Modals @using EDU.SIS.Web.Areas.app.Models.Demo @model DemoObjectViewModel @await Html.PartialAsync("~/Areas/app/Views/Common/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel("详情")) <div> <div> <div> <div> <h6>@L("Name") :</h6> @Model.Name </div> <div> <h6>@L("Age") :</h6> @Model.Age </div> <div> <h6>@L("IsVip") :</h6> @Model.IsVip </div> <div> <h6>@L("EndDateTime") :</h6> @Model.EndDateTime </div> </div> </div> </div> @await Html.PartialAsync("~/Areas/app/Views/Common/Modals/_ModalFooterWithClose.cshtml")三、在index.js中获取ViewDemoObjectModal对象,再给datatable操作方法列,添加查看详情点击事件
//单条数据详情,获取模态对话框对象 var _viewDemoObjectModal = new app.ModalManager({ viewUrl: abp.appPath + \'app/Demo/ViewDemoObjectModal\', modalClass: \'ViewDemoObjectModal\' }); //给datatable操作方法列,添加查看详情点击事件 { text: app.localize(\'View\'), visible: function () { return true;}, action: function (data) { //查看数据 //console.log(\'view\'); _viewDemoObjectModal.open({ id: data.record.demoObject.id }); } }, 总结通过学习,完成了单个实体的添加、修改、删除、查看详情操作;