在我看来,我有以下几点:
<div id="tbAddress" class="row">
<div class="span12">
<div class="row">
<div class="span1"> </div>
<div class="span11">
<h2>Mailing Address</h2>
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Address</div>
<div class="span9">
<input type="text" data-bind="value: MailingAddress1 " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Address 2</div>
<div class="span9">
<input type="text" data-bind="value: MailingAddress2 " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">City</div>
<div class="span9">
<input type="text" data-bind="value: MailingCity " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">State</div>
<div class="span3">
<select data-bind="value: MailingState">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">Dist of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
</div>
<div class="span1"> </div>
<div class="span2">Zip Code</div>
<div class="span3">
<input type="text" data-bind="value: MailingZIP " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Phone</div>
<div class="span3">
<input type="text" data-bind="value: Phone " />
</div>
<div class="span1"> </div>
<div class="span2">Fax</div>
<div class="span3">
<input type="text" data-bind="value: Fax " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Email</div>
<div class="span9">
<input type="text" data-bind="value: Email " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Website</div>
<div class="span9">
<input type="text" data-bind="value: Website " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span7">
<h2>Physical Address</h2>
</div>
<div class="span4">
<button type="submit" data-bind="click: $parent.sameAsMailingAddressClicked">Physical Address Same as Mailing</button>
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Address</div>
<div class="span9">
<input type="text" data-bind="value: PhysicalAddress1 " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">Address 2</div>
<div class="span9">
<input type="text" data-bind="value: PhysicalAddress2 " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">City</div>
<div class="span9">
<input type="text" data-bind="value: PhysicalCity " />
</div>
</div>
<div class="row">
<div class="span1"> </div>
<div class="span2">State</div>
<div class="span3">
<select data-bind="value: PhysicalState">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">Dist of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
</div>
<div class="span1"> </div>
<div class="span2">Zip Code</div>
<div class="span3">
<input type="text" data-bind="value: PhysicalZIP " />
</div>
</div>
</div>
</div>
与邮件相同的按钮然后在我的视图模型中调用此函数
function doSameMailing(){
var ap = self.activePermit();
ap.PhysicalAddress1(ap.MailingAddress1());
ap.PhysicalAddress2(ap.MailingAddress2());
ap.PhysicalCity(ap.MailingCity());
ap.PhysicalState(ap.MailingState());
ap.PhysicalZIP(ap.MailingZIP());
}
在 viewAttached 处理程序中,我有以下代码使输入和选择语句利用 wijmo 控件。
$('select').wijcombobox();
$(':text').wijtextbox();
我想将邮寄地址复制到物理地址字段中,这适用于除该字段之外的所有PhysicalState
字段。如果我检查视图模型,则视图模型中的物理状态值会更改,但视图不会更新选择中的值。如果我点击保存按钮,PhysicalState 字段将被保存为正确的值。
我正在使用以下内容:
- wijmo专业版2013.v1.2
- 杜兰达尔
- 微风
- jQuery 1.90.1
- jqueryui 1.10.2
- 淘汰赛2.2.1