本文整理匯總了TypeScript中knockback.viewModel函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript viewModel函數的具體用法?TypeScript viewModel怎麽用?TypeScript viewModel使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了viewModel函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Load
Load() {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
//var model = new dto.Models.BusDto();
var model = this.backboneModel;
this.busViewModel.bbModel = model;
this.busViewModel.model = kb.viewModel(model);
// debugger;
model.set("trackingDeviceId", "");
model.set("vehicleNo", "");
model.set("alkhidmatCentreList", lookupResponse.alkhidmatCentre);
model.set("alkhidmatCentreSelected", "");
model.set("busModelList", lookupResponse.busModel);
model.set("busModelSelected", "");
model.set("no", "");
model.set("description", "");
model.set("initialReading","");
model.set("isActive", "1");
this.busViewModel = new views.BusViewModel(model, this);
this.busView = new views.BusView({ viewModel: this.busViewModel });
this.busView.on("SaveBus", () => this.Save(this.busViewModel.bbModel));
this.busView.on("CancelForm", () => this.Cancel());
//this.layout = app.AppLayout;
this.app.MainRegion.show(this.busView);
//this.GetAll();
}
示例2: Load
Load() {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
//var model = new dto.Models.DriverDto();
var model = this.backboneModel;
this.driverViewModel.bbModel = model;
this.driverViewModel.model = kb.viewModel(model);
// debugger;
model.set("firstName", "");
model.set("lastName", "");
model.set("alkhidmatCentreList", lookupResponse.alkhidmatCentre);
model.set("alkhidmatCentreSelected", "");
model.set("cnic", "");
model.set("address", "");
model.set("city", "");
model.set("mobile", "");
model.set("isActive", "");
this.driverViewModel = new views.DriverViewModel(model, this);
this.driverView = new views.DriverView({ viewModel: this.driverViewModel });
this.driverView.on("SaveDriver", () => this.Save(this.driverViewModel.bbModel));
this.driverView.on("CancelForm", () => this.Cancel());
//this.layout = app.AppLayout;
this.app.MainRegion.show(this.driverView);
//this.GetAll();
}
示例3: Load
Load() {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
//var model = new dto.Models.StationDto();
var model = this.backboneModel;
this.stationViewModel.bbModel = model;
this.stationViewModel.model = kb.viewModel(model);
model.set("name", "");
model.set("address", "");
model.set("landmarkIdSelected", "");
model.set("landmarkList", lookupResponse.landmark);
model.set("contactNo1", "");
model.set("contactNo2", "");
model.set("isCoPartner", "");
model.set("isActive", "");
this.stationViewModel = new views.StationViewModel(model, this);
this.stationView = new views.StationView({ viewModel: this.stationViewModel });
this.stationView.on("SaveAlkhidmatCentre", () => this.Save(this.stationViewModel.bbModel));
this.stationView.on("CancelForm", () => this.Cancel());
//this.layout = app.AppLayout;
this.app.MainRegion.show(this.stationView);
//this.GetAll();
}
示例4: Load
Load() {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
var model = this.backboneModel;
this.userViewModel.bbModel = model;
this.userViewModel.model = kb.viewModel(model);
// debugger;
model.set("firstName", "");
model.set("lastName", "");
model.set("alkhidmatCentreList", lookupResponse.alkhidmatCentre);
model.set("alkhidmatCentreSelected", "");
model.set("roleList", lookupResponse.role);
model.set("roleSelected", "");
model.set("cnic", "");
model.set("userName", "");
model.set("address", "");
model.set("city", "");
model.set("mobile", "");
model.set("email", "");
model.set("isActive", "1");
this.userViewModel = new views.UserViewModel(model, this);
this.userView = new views.UserView({ viewModel: this.userViewModel });
this.userView.on("SaveUser", () => this.Save(this.userViewModel.bbModel));
this.userView.on("CancelForm", () => this.Cancel());
this.app.MainRegion.show(this.userView);
}
示例5: Load
Load() {
var model = this.backboneModel;
model.set("fromBookingDate", helper.FormatDateString(Date.now()));
model.set("toBookingDate", helper.FormatDateString(Date.now()));
this.compositeModel = model;
this.collectionView.listenTo(this.collectionView, "AdminSearchBooking", () => this.GetByCriteria(this.searchViewModel.bbModel));
this.collectionView.listenTo(this.collectionView, "Event:PrintReport", (p) => {
helper.PrintReport(this.backboneCollection, this.GetHeaderList(), "Centre Specific Summary Report","Booking");
});
this.collectionView.listenTo(this.collectionView, "itemview:CentreBusSummary", (view, id) => { this.ShowCentreBusSummary(id,model); });
this.collectionView.on("CancelForm", () => this.Cancel());
this.app.MainRegion.show(this.collectionView);
var vm = kb.viewModel(this.compositeModel);
var fromBookingDate = $('#txtFromBookingDate')[0];
ko.cleanNode(fromBookingDate);
ko.applyBindings(vm, fromBookingDate);
var toBookingDate = $('#txtToBookingDate')[0];
ko.cleanNode(toBookingDate);
ko.applyBindings(vm, toBookingDate);
}
示例6: Load
Load() {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
var model = this.backboneModel;
this.nearestCentreSetupViewModel.bbModel = model;
this.nearestCentreSetupViewModel.model = kb.viewModel(model);
// debugger;
model.set("alkhidmatCentreList", lookupResponse.alkhidmatCentre);
model.set("alkhidmatCentreSelected", "");
model.set("nearestCentreSelected", "");
model.set("nearestLevel", "");
model.set("isActive", "1");
this.nearestCentreSetupViewModel = new views.NearestCentreSetupViewModel(model, this);
this.nearestCentreSetupView = new views.NearestCentreSetupView({ viewModel: this.nearestCentreSetupViewModel });
this.nearestCentreSetupView.on("SaveNearestCentreSetup", () => this.Save(this.nearestCentreSetupViewModel.bbModel));
this.nearestCentreSetupView.on("CancelForm", () => this.Cancel());
//this.layout = app.AppLayout;
this.app.MainRegion.show(this.nearestCentreSetupView);
//this.GetAll();
}
示例7: Load
Load() {
var model = this.backboneModel;
model.set("fromBookingDate", helper.FormatDateString(Date.now()));
model.set("toBookingDate", helper.FormatDateString(Date.now()));
this.compositeModel = model;
this.collectionView.listenTo(this.collectionView, "AdminSearchBooking", () => this.GetByCriteria(this.searchViewModel.bbModel));
this.collectionView.on("CancelForm", () => this.Cancel());
this.app.MainRegion.show(this.collectionView);
var vm = kb.viewModel(this.compositeModel);
var fromBookingDate = $('#txtFromBookingDate')[0];
ko.cleanNode(fromBookingDate);
ko.applyBindings(vm, fromBookingDate);
var toBookingDate = $('#txtToBookingDate')[0];
ko.cleanNode(toBookingDate);
ko.applyBindings(vm, toBookingDate);
}
示例8: UIBinding
UIBinding(model: any) {
model.set("isActive", model.get("isActive") ? "1" : "0");
this.townViewModel.bbModel = model;
this.townViewModel.model = kb.viewModel(model);
ko.cleanNode($(this.townView.el)[0]);
ko.applyBindings(this.townViewModel, this.townView.el);
}
示例9: UIBinding
UIBinding(model: any) {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
model.set("unionCouncilList", lookupResponse.unionCouncil);
var unionCouncil = _.filter(lookupResponse.unionCouncil, (p) => { return p.id == model.get("ucId"); });
model.set("unionCouncilIdSelected", unionCouncil[0]);
model.set("isActive", model.get("isActive") ? "1" : "0");
this.landmarkViewModel.bbModel = model;
this.landmarkViewModel.model = kb.viewModel(model);
ko.cleanNode($(this.landmarkView.el)[0]);
ko.applyBindings(this.landmarkViewModel, this.landmarkView.el);
}
示例10: SimpleLoad
SimpleLoad() {
var lookupResponse = JSON.parse(localStorage.getItem('lookupResponse'));
this.compositeModel.set("busList", lookupResponse.bus);
this.compositeModel.set("busSelected", "");
this.collectionView.model = this.compositeModel;
//this.collectionView.on("itemview:ShowDetail", (view) => this.GetByIdCompleted(view.model));
this.collectionView.listenTo(this.collectionView, "Event:SearchVisit", (busId) => this.SearchVisit(busId));
this.app.MainRegion.show(this.collectionView);
var vm = kb.viewModel(this.compositeModel);
vm.setOptionDisable = this.collectionView.setOptionDisable;
var element = $('#ddlBusDetails')[0];
ko.cleanNode(element);
ko.applyBindings(vm, element);
}