From 780448c7f8e2815a509c4bf54a890d3934b9f3b9 Mon Sep 17 00:00:00 2001 From: John Culviner Date: Wed, 24 Apr 2013 22:46:47 -0500 Subject: [PATCH] cleanup of summary page --- demo/SurveyApp.Web/App/viewmodels/surveys.js | 3 -- demo/SurveyApp.Web/App/views/surveys.cshtml | 46 +++++++++++--------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/demo/SurveyApp.Web/App/viewmodels/surveys.js b/demo/SurveyApp.Web/App/viewmodels/surveys.js index 9a3968e..6523973 100644 --- a/demo/SurveyApp.Web/App/viewmodels/surveys.js +++ b/demo/SurveyApp.Web/App/viewmodels/surveys.js @@ -5,7 +5,6 @@ var self = this; self.surveySummaries = null; //loaded from ajax as ko.observableArray() - self.loading = ko.observable(true); self.selectedSurvey = ko.observable(null); //the router's activator calls this function and waits for the .complete jQuery Promise before @@ -19,8 +18,6 @@ if (self.surveySummaries().length > 0) self.toggleSelected(self.surveySummaries()[0]); - - self.loading(false); }); }; diff --git a/demo/SurveyApp.Web/App/views/surveys.cshtml b/demo/SurveyApp.Web/App/views/surveys.cshtml index 26b2bab..14d44ee 100644 --- a/demo/SurveyApp.Web/App/views/surveys.cshtml +++ b/demo/SurveyApp.Web/App/views/surveys.cshtml @@ -29,10 +29,15 @@ @using (var summary = summaries.ForEachKoComment()) { - db.Text(x => x.LastName))> + + @*probably the preferred way*@ + db.Text(x => x.LastName))> db.Text(x => x.FirstName))> db.Text(x => x.DateOfBirth))> - db.Text(x => x.Gender))> + + @*if you like pain*@ + @summary.ElementSelfClosing("td", true).DataBind(db => db.Text(x => x.Gender)) + @*EDIT*@ } - + No survey found @@ -56,7 +61,6 @@ New Survey -
@@ -64,22 +68,24 @@ @{ var detail = this.KnockoutHelperForApi().Endpoint(api => api.Get().Single(), "selectedSurvey", true); } -
- db.Text(x => x.LastName))>, db.Text(x => x.FirstName))> -
-
- @detail.LabelFor(x => x.NumberOfTechProducts).Class("control-label") -
db.Text(x => x.NumberOfTechProducts)).Class("uneditable controls")>
-
-
- @detail.LabelFor(x => x.NumberOfChildren).Class("control-label") -
db.Text(x => x.NumberOfChildren)).Class("uneditable controls")>
-
+
+ + @detail.BoundTextFor(x => x.LastName), @detail.BoundTextFor(x => x.FirstName) + + +
+ @detail.LabelFor(x => x.NumberOfTechProducts).Class("control-label") +
db.Text(x => x.NumberOfTechProducts)).Class("uneditable controls")>
+
+
+ @detail.LabelFor(x => x.NumberOfChildren).Class("control-label") +
db.Text(x => x.NumberOfChildren)).Class("uneditable controls")>
+
- @*Inject a 'shared view' into the DOM specifiying the model and view to compose together*@ -
-
- -
+ @*Inject a 'shared view' into the DOM specifiying the model and view to compose together*@ +
+
+ +
\ No newline at end of file