Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141160 | Nov 27,2018 02:44 PM UTC | Nov 29,2018 08:39 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
<div class="control-section">
@Html.EJS().Grid("DialogTemplateEdit").DataSource((IEnumerable<object>)ViewBag.dataSource).ActionComplete("actionComplete").Columns(col =>
{
. . .
}).AllowPaging().PageSettings(page => page.PageCount(2)).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog).Template("#dialogtemplate"); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render()
</div>
<script>
var div = ej.base.createElement('div', { id: 'dlg' });
function actionComplete(args) {
if (args.requestType === 'beginEdit') {
args.dialog.header = 'Edit Dialog';
. . . }
if (args.requestType === 'add') {
args.dialog.header = 'Add Dialog';
. . .
}
}
</script> |
<div class="control-section">
@Html.EJS().Grid("DialogTemplateEdit").DataSource((IEnumerable<object>)ViewBag.dataSource).ActionComplete("actionComplete").Columns(col =>
{
. . .
}).AllowPaging().PageSettings(page => page.PageCount(2)).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog).Template("#dialogtemplate"); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render()
</div>
<script>
function actionComplete(args) {
if (args.requestType === 'beginEdit') {
args.dialog.height = '400px';
. . .
}
}
</script> |
<div class="control-section">
@Html.EJS().Grid("DialogTemplateEdit").DataSource((IEnumerable<object>)ViewBag.dataSource).ActionComplete("actionComplete").Columns(col =>
{
. . .
}).AllowPaging().PageSettings(page => page.PageCount(2)).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog).Template("#dialogtemplate"); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render()
</div>
<script>
function actionComplete(args) {
. . .
if (args.requestType === 'save') {
var toastObj = new ej.notifications.Toast({
position: {
X: 'Right'
}, target: document.body
});
toastObj.appendTo('#DialogTemplateEdit');
toastObj.show({ title: 'Information!', content: 'You can Print the data now.', cssClass: 'e-toast-info', icon: 'e-info toast-icons' });
}
}
</script> |
namespace mvc_ej2
{
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
. . . . .
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css")); // remove the default site.css
}
}
}
|
<style>
.e-dlg-content .e-gridform input, select, textarea {
max-width: 100% !important;
}
</style> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.