kendo ui - KendoUI DataSource binding to MVVM grid in durandal (using hottowel template) doesn't seem to work -
I am using the Visual Studio 2012 Update 2 Hotlawl template with updated driver and jquery nuget packages ...
Here is my code: Durandal main.js:
needed.config ({path: {"text": "durandal / amd / text"}}); , ([ 'Durandal / app' Durandal / ViewLocator 'Durandal / viewModelBinder' Durandal / system ',' Durandal / plugins / router 'services / logger "], function (application, ViewLocator, the viewModelBinder Define system, router, logger) enable // debugging message to show in {// console system.debug (true); app.start () {toastr.options.positionClass = 'toast-bottom-right' ; toastr.options.backgroundpositionClass = 'toast-down-right'; router.handleInvalidRoute = function (routing parameters) {logger.logError ( 'No route found' route, 'Chief', true);}; // When finding a viewmodel moe Yul, optimize it for touch rather // viewmodel string with the view to finding fellow visual RouterkuseConvention () ;k ViewLocatorkuseConvention (); // devices app.adaptToDevice (); kendo.ns = " Kendo- "; ViewModelBinder.beforebind = function (obj, view) {kendo.bind (see, obj.viewModel || obj);}; // Show the app by setting a root view model for our app.Ep.setRoot (' Viewmodels / shell ',' entrance ');});}); Durandal viewmodel:
defined (['Services / DataContext', 'Durandal / plugins / router'], function (DataContext, router) {var Active = function () {// Yes Yes - I will do it differently in a Detacontekst - it is debugging simplicity var service = $ data.initService ( "https://open.jaystack.net/c72e6c4b-27ba-49bb as -9321-e167ed03d00b / want 6494690e-1d5f-418d-ADCA-0ac515b7b742 / API / mydatabase / "); // return promised Durandal ... back Servicekthen (function (database) to find {vm.set ( In "airports", Db.Airport.asKendoDataSource ());});} var disabled = function () {}; var TrueAdded = function (see) {//kendo.init($"#airportGrid "}"); // kendo.bind (see, VM); //kendo.bind($"#airportGrid "), VM);}; Var VM = new kendo.data.ObservableObject (activate: active, inactive: passive, airports [], title: 'airports', added to view: approved to view}); Return vm;}); Durandal View:
& lt; Section & gt; & Lt; H2 class = "page-title" data-bind = "text: title" & gt; & Lt; / H2 & gt; & Lt; Div id = "airportGrid" data -Cendo-roll = "grid" data-kendo-sortable = "true" data-kendo-pageable = "true" data-kendo-page-size = "25" data-kendo-editable = "True" data-kendo-column = '["id", "abbrew", "name"]' data-condo-bind = "source: airport" & gt; & Lt; / Div & gt; & Lt; / Section & gt; I'm being called to do Jacek in Chrome's network monitor: and I see data coming back.
The Kendui grid is well-formed but there is no data in it (I think it means that Kendui is happy and is being forced to MVVM binding, although the Kendui grid I do not want to understand Kendui Datastro created by Jayender)
Without acting it works as well:
I am trying and now for 2 days Trying - what to do Can you help me?
Thanks TJ
It seems that everything is now to remove those parts The latter is working only which are essential for air.
However, to ensure that a) activate vm in vm.airports and and b) There is no need to create a dummy, Vm.airports canodeetadetasource () which is overwritten by any means active ten in define (function () {var vm = new kendo.data.ObservableObject (activate: active, deactivate: deactivate, // airport: new kendo.data.DataSource ( ), Title: 'airports', added to view: attached to view}); return vm; activate the function () {var service = $ data.initService ("https://open.jaystack.net/ c72e6c4b-27ba-49bb-9321-e167ed03d00b / 6494690e-1d5f-418d-adca-0ac515b7b742 / api / mydatabase / "); return service. then (function (dB) {vm.airports = db.Airport.asKendoDataSource ();} );} Deactivate the function () {} Attach the view view Security was (see) {//kendo.init($"#airportGrid ")); //kendo.bind (see, VM); //kendo.bind($((#airportGrid "), VM);}});
Comments
Post a Comment