hey guys.
I'm using a grid with popup editmode which looks like:
The Template used looks like this:
what I want to implement now is something like this:
after the sumbit(save, update) button is clicked I don't want the window to close. I want it to remain open and display something like a progressbar or an ajax loader to inform the user that sth. is happening right now and there's no need to submit again.
in the background there will be items added to the database and I want to display the amount of items added on a new view.
when the db operation is finished the loader should disappear and something like: 6 items have been added to the database should be displayed on a lets call it success view.
hopefully there's a way without creating kendo windows, having partial views with the content displayed and an ajax.beginform.
thanks in advance
cheers, tom
I'm using a grid with popup editmode which looks like:
@(Html.Kendo().Grid<
Pattern
>()
.Name("Pattern")
.ToolBar(toolbar =>
{
toolbar.Create().Text("New Pattern");
}
)
.DataSource(dataSource =>
dataSource.Ajax().PageSize(50)
.Model(model =>
{
model.Id(s => s.RegExID);
model.Field(s => s.Category).DefaultValue(new Category());
model.Field(s => s.Table).DefaultValue(new ExpressionTable());
model.Field(s => s.Version).DefaultValue("%");
}
)
.Create(create => create.Action("CreatePattern", "Pattern"))
.Destroy(destroy => destroy.Action("DeletePattern", "Pattern"))
.Update(update => update.Action("UpdatePattern", "Pattern"))
.Read(reader => reader.Action("LoadPattern", "Pattern"))
)
.Sortable()
.Selectable()
.Pageable(pager =>
{
pager.Enabled(true).Refresh(true).PageSizes(new int[] { 50, 100, 150 });
pager.Info(false);
})
.Scrollable(s => s.Enabled(true).Height(500))
.Filterable(filterable =>
filterable.Extra(false).Operators(operators => operators
.ForString(str =>
str.Clear()
.StartsWith("Starts with")
.Contains("Contains")
)
)
)
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("PatternPopUp")
)
)
The Template used looks like this:
@Html.HiddenFor(model => model.RegExID)
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.Table)
</
div
>
<
div
class
=
"editor-field"
>
@(Html.Kendo().DropDownListFor(model => model.Table)
.OptionLabel("Please select a value")
.HtmlAttributes(new { style = "width: 200px" })
.AutoBind(true)
.Name("Table")
.DataTextField("Name")
.DataValueField("TableID")
.Events(e =>
{
e.Select("select");
e.DataBound("bound");
}
)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetRegExpressions", "Pattern");
})
.ServerFiltering(true);
})
)
</
div
>
<
div
id
=
"regSW"
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.SoftwareName)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.SoftwareName)
@Html.ValidationMessageFor(model => model.SoftwareName)
</
div
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.SoftwarePublisher)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.SoftwarePublisher)
@Html.ValidationMessageFor(model => model.SoftwarePublisher)
</
div
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.Version)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.Version)
@Html.ValidationMessageFor(model => model.Version)
</
div
>
</
div
>
<
div
id
=
"regMachine"
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.InstallSource)
</
div
>
<
div
class
=
"editor-field"
>
@Html.EditorFor(model => model.InstallSource)
@Html.ValidationMessageFor(model => model.InstallSource)
</
div
>
</
div
>
<
div
class
=
"editor-label"
>
@Html.LabelFor(model => model.Category)
</
div
>
<
div
class
=
"editor-field"
>
@(Html.Kendo().DropDownListFor(model => model.Category)
.OptionLabel("Please select a value")
.HtmlAttributes(new { style = "width: 200px" })
.AutoBind(false)
.Name("Category")
.DataTextField("Name")
.DataValueField("CategoryID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetCategories", "Software");
})
.ServerFiltering(true);
})
)
</
div
>
<
div
class
=
"editor-label"
id
=
"regDeslbl"
>
@Html.LabelFor(model => model.Description)
</
div
>
<
div
class
=
"editor-field"
id
=
"regDesfld"
>
@Html.TextAreaFor(model => model.Description, new { @class = "k-textbox", style = "width: 200px" })
@Html.ValidationMessageFor(model => model.Description)
</
div
>
<
script
>
$("#regSW").hide();
$("#regMachine").hide();
</
script
>
what I want to implement now is something like this:
after the sumbit(save, update) button is clicked I don't want the window to close. I want it to remain open and display something like a progressbar or an ajax loader to inform the user that sth. is happening right now and there's no need to submit again.
in the background there will be items added to the database and I want to display the amount of items added on a new view.
when the db operation is finished the loader should disappear and something like: 6 items have been added to the database should be displayed on a lets call it success view.
hopefully there's a way without creating kendo windows, having partial views with the content displayed and an ajax.beginform.
thanks in advance
cheers, tom