or
<
body
>
<
div
id
=
"rootView"
data-role
=
"view"
data-init
=
"verifyLogin"
>
</
div
>
<
script
>
var isLoggedIn = false;
var app = new kendo.mobile.Application($(document.body), {
initial: "rootView"
});
function verifyLogin() {
app.navigate("http://127.0.0.2:81/Mobile/Account/Login");
}
</
script
>
</body
<
div
data-role
=
"view"
data-title
=
"Login"
data-reload
=
"true"
id
=
"viewLogin"
>
<
form
action
=
"@OurApp.Core.Web.UrlHelper.GetUrlRoot()/Mobile/Account/Login"
data-ajax
=
"true"
data-ajax-mode
=
"replace"
data-ajax-success
=
"onSuccess"
data-ajax-update
=
"#loginForm"
id
=
"loginForm"
method
=
"post"
>
@Html.AntiForgeryToken()
<
div
>
<
div
>
<
fieldset
>
<
header
>
<
legend
>Login</
legend
>
</
header
>
<
div
class
=
"widget-inner clearfix"
>
@Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")
<
div
class
=
"control-group"
>
<
label
class
=
"control-label"
>@Html.LabelFor(model => model.UserName, new { @class = "bold" })</
label
>
<
div
class
=
"controls"
>
@Html.TextBoxFor(model => model.UserName, new { autofocus = "autofocus", @class = "input-block-level", tabindex = "1" })
@Html.ValidationMessageFor(model => model.UserName)
</
div
>
</
div
>
<
div
class
=
"control-group"
>
<
label
class
=
"control-label clearfix"
>
@Html.LabelFor(model => model.Password, new { @class = "bold pull-left" })
</
label
>
<
div
class
=
"controls"
>
@Html.PasswordFor(model => model.Password, new { @class = "input-block-level", tabindex = "2" })
@Html.ValidationMessageFor(model => model.Password)
</
div
>
</
div
>
<
div
class
=
"clearfix"
>
<
div
class
=
"pull-right"
style
=
"margin-left: 16px;"
>
<
button
type
=
"submit"
class
=
"btn btn-primary disable-onclick"
tabindex
=
"4"
style
=
"margin-top: 0;"
>Login</
button
>
</
div
>
<
div
class
=
"pull-right"
style
=
"margin-top: 6px;"
>
@Html.LabelFor(model => model.RememberMe, new { @class = "pull-left", style = "font-size: 12px;" })
@Html.CheckBoxFor(model => model.RememberMe, new { @class = "pull-left", style = "margin-left: 6px;", tabindex = "3" })
@Html.ValidationMessageFor(model => model.RememberMe)
</
div
>
</
div
>
</
div
>
</
fieldset
>
</
div
>
</
div
>
</
form
>
<
script
type
=
"text/javascript"
>
$(function () {
var form = $("#loginForm");
form.removeData('validator');
form.removeData('unobtrusiveValidation');
$.validator.unobtrusive.parse(form);
});
function onSuccess() {
alert('success');
}
</
script
>
</
div
>
public
ActionResult Login()
{
return
PartialView(
new
LoginViewModel());
}
[HttpPost]
public
ActionResult Login(LoginViewModel model)
{
return
PartialView(model);
}
<!DOCTYPE html>
<
html
>
<
head
>
<
title
></
title
>
<
link
href
=
"//cdn.kendostatic.com/2013.1.319/styles/kendo.common.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"//cdn.kendostatic.com/2013.1.319/styles/kendo.default.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"//twitter.github.io/bootstrap/assets/css/bootstrap.css"
rel
=
"stylesheet"
/>
<
script
src
=
"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
></
script
>
<
script
src
=
"//cdn.kendostatic.com/2013.1.319/js/kendo.all.min.js"
></
script
>
<
script
src
=
"//twitter.github.io/bootstrap/assets/js/bootstrap-transition.js"
></
script
>
<
script
src
=
"//twitter.github.io/bootstrap/assets/js/bootstrap-modal.js"
></
script
>
</
head
>
<
body
>
<!-- Button to trigger modal -->
<
a
href
=
"#myModal"
role
=
"button"
class
=
"btn"
data-toggle
=
"modal"
>Launch demo modal</
a
>
<!-- Modal -->
<
div
id
=
"myModal"
class
=
"modal hide fade"
tabindex
=
"-1"
role
=
"dialog"
aria-labelledby
=
"myModalLabel"
aria-hidden
=
"true"
>
<
div
class
=
"modal-header"
>
<
button
type
=
"button"
class
=
"close"
data-dismiss
=
"modal"
aria-hidden
=
"true"
>X</
button
>
<
h3
id
=
"myModalLabel"
>Modal header</
h3
>
</
div
>
<
div
class
=
"modal-body"
>
<
textarea
id
=
"editor"
rows
=
"10"
cols
=
"30"
style
=
"width:100%;height:400px"
></
textarea
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
class
=
"btn"
data-dismiss
=
"modal"
aria-hidden
=
"true"
>Close</
button
>
<
button
class
=
"btn btn-primary"
>Save changes</
button
>
</
div
>
</
div
>
<
script
>
$("#editor").kendoEditor({
tools: [
"bold",
"italic",
"underline",
"strikethrough",
"fontName",
"fontSize",
"foreColor",
"backColor",
"justifyLeft",
"justifyCenter",
"justifyRight",
"justifyFull",
"insertUnorderedList",
"insertOrderedList",
"indent",
"outdent",
"formatBlock",
"createLink",
"unlink",
"insertImage",
"subscript",
"superscript",
"viewHtml"
]
});
var editor = $("#editor").data("kendoEditor");
editor.value("test testes");
</
script
>
</
body
>
</
html
>
@model Papr2WebMvc4.Models.PiprForms.Tobacco
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<
h2
>Edit Refering Tobacco users</
h2
>
<
fieldset
>
<
legend
></
legend
>
<
div
>
<
label
>Month</
label
>
@Html.TextBoxFor(model => model.Month)/@Html.TextBoxFor(model => model.Year)
</
div
>
<
div
>
<
label
>Number of peope referred this month to:</
label
>
<
div
>
<
div
>
<
span
>
<
label
>Quitline</
label
>
@Html.TextBoxFor(model => model.Count)
</
span
>
</
div
>
<
div
>
<
span
>
<
label
>QuitNet</
label
>
@Html.TextBoxFor(model => model.Count2)
</
span
>
</
div
>
<
div
>
<
span
>
<
label
>Local Cessation</
label
>
@Html.TextBoxFor(model => model.Count3)
</
span
>
<
span
class
=
"hiddenElement"
style
=
"display: none"
>
<
label
>Local Group Name</
label
>
@Html.TextBoxFor(model => model.FormName)
</
span
>
</
div
>
</
div
>
</
div
>
</
fieldset
>
<
script
>
$(window).load(function () {
trace("Begin");
alert($('#Count3').val());
var localCessation = $('#Count3').val();
trace(localCessation);
});
$(document).ready(
function myfunction() {
trace("Begin");
$('#Count3').change(function (event) {
trace("Text Changed");
var text = $(this).val();
if (text) {
trace("Has Text");
$('.hiddenElement').show("fast");
}
else {
trace("No Text");
$('#FormName').val(null);
$('.hiddenElement').hide("fast");
}
});
});
</
script
>
}
@(Html.Kendo()
.Grid<
Papr2WebMvc4.Models.PiprForms.Tobacco
>()
.Name("tobaccoGrid")
.HtmlAttributes(new { @class = "primaryGridStyle" })
.Columns(columns =>
{
columns.Bound(form => form.Date).Title("Date").Format("{0:M/yyyy}");
columns.Bound(form => form.Count).Title("Quitline");
columns.Bound(form => form.Count2).Title("QuitNet");
columns.Bound(form => form.Count3).Title("Local Cessation");
columns.Bound(form => form.FormName).Title("Local Group Name");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(100);
})//end columns
.Editable(edit => edit.Mode(GridEditMode.PopUp).TemplateName("AddEditTobacco"))
.ToolBar(toolbar => toolbar.Create())
.Sortable()
.Filterable()
.Pageable(page => page.PageSizes(true))
.DataSource(datasource => datasource
.Ajax()
.Model(model => model.Id(tobacco => tobacco.Id))
.ServerOperation(false)
.Read(read => read.Action("GetForm", "Form", new
{
planId = Convert.ToInt32(Session["PlanId"]),
planActivityId = Model.PlanActivityId,
activityType = Model.ActivityType,
activityTypeId = Model.ActivityTypeId
}))//end read
.Create(create => create.Action("AddForm", "Form", new { planActivityId = Model.PlanActivityId, activityTypeId = 11 }))//end create
.Update(update => update.Action("EditForm", "Form", new { planActivityId = Model.PlanActivityId, activityTypeId = 11, activityType = Model.ActivityType }))//end update
.Destroy(update => update.Action("DeleteForm", "Form", new { planActivityId = Model.PlanActivityId }))//end destroy
.Events(events=>events.RequestEnd("onRequestEnd"))//end events
)//end datasoruce
)@*End tobacco grid*@
Is there something else I should be using to reset the textbox value so it is consumed by my model using javascript/jquery.
$(
'#btnSearch'
).on(
"click"
,
function
(e) {
refreshGrid();
return
false
;
});
function
refreshGrid() {
$filter =
new
Array();
$filter.push({ field:
"StudentID"
, operator:
"contains"
, value: $(
'#txtStudentID'
).val() });
if
($(
'#AwardType'
).val()) {
$filter.push({ field:
"Award.AwardTypeID"
, operator:
"eq"
, value: $(
'#AwardType'
).val() });
}
var
grid = $(
"#Grid"
).data(
"kendoGrid"
);
grid.dataSource.filter($filter);
grid.dataSource.read();
}
public ActionResult ApplicationSearch_Read([DataSourceRequest]DataSourceRequest request)
{
var
applications = context.Applications.Include(
"ApplicationDetails"
).OrderByDescending(p => p.SubmittedDate).ToList();
var
data = applications.Select(x =>
new
{
ApplicationID = x.ApplicationID,
SubmittedDate = x.SubmittedDate,
FirstName = x.FirstName,
LastName = x.LastName,
StudentID = x.StudentID,
IsApplicationSubmitted = x.IsApplicationSubmitted,
Award = x.ApplicationDetails.Select(y =>
new
{
AwardID = y.AwardDetail.AwardID,
AwardName = y.AwardDetail.Award.AwardName,
AwardTypeID = y.AwardDetail.Award.AwardTypeID
})
});
return
Json(data.ToDataSourceResult(request));
}