Using the following.
1) Visual Studio 2012. 2) Hot towel template. 3) downloaded ko grid and and its css.
home.html
<section id="alerts-view" class="view">
<header>
<a class="btn btn-info btn-force-refresh pull-right"
data-bind="click: refresh" href="#"><i class="icon-refresh"></i> Refresh</a>
<h3 class="page-title" data-bind="text: title"></h3>
<div class="article-counter">
<address data-bind="text: alerts().length"></address>
<address>found</address>
</div>
</header>
<div data-bind="koGrid: gridOptions"></div>
</section>
home.js
define(['services/datacontext', 'durandal/plugins/router'],
function (datacontext, router) {
var alerts = ko.observableArray();
isAttachedToView = ko.observable(false);
var activate = function (routeData) {
if (routeData.id == undefined)
return datacontext.getAlerts(alerts);
};
var deactivate = function () {
isAttachedToView(false);
alerts([]);
};
var refresh = function () {
return datacontext.getAlerts(alerts);
};
var vm = {
activate: activate,
deactivate: deactivate,
refresh: refresh,
alerts: alerts,
gridOptions: {
data: alerts,
canSelectRows: true,
enableColumnResize: true,
footerVisible: true,
displaySelectionCheckbox: true,
enableSorting: ko.observable(true),
columnDefs: [
{ field: 'efficency', displayName: 'Green or C02 Bus' } ......................
]
},
isAttachedToView: isAttachedToView,
title: 'Current Alerts'
};
return vm;
function viewAttached() {
isAttachedToView(true);
return true;
}
});
Bundle config.
bundles.Add(
new StyleBundle("~/Content/css")
//.Include("~/Content/ie10mobile.css")
//.Include("~/Content/bootstrap.css")
//.Include("~/Content/bootstrap-responsive.css")
//.Include("~/Content/font-awesome.css")
//.Include("~/Content/durandal.css")
.Include("~/Content/toastr.css")
// .Include("~/Content/app.css")
.Include("~/Content/KoGrid.css")
// .Include("~/Content/jquery-ui-1.9.1.custom.css")
);
Second Picture I have no idea on what's going wrong or what i am doing wrong here, but looks like the following 2 pictures.
first dont see any grid. Resize the window you see the grid but only one row. try and group on the G green buss then when you want to make the col bigger the second col starts to shift rather than the fist one.
is there some thing which works or example which works with Hottowel template and kogrid which i can download and use?
Looks like a schoolboy error, but difficult to find and reason.