Search code examples
knockout.jsbreezedurandalhandsontable

Excel-like plugin to work with Durandal Breeze and Knockout


I need to build an SPA with Durandal Breeze and Knockout, but for data entry I need to show sections similar to excel.

I had found a nice plugin Handsontable this in appearance is exactly for me, but I don't know if this plugin is compatible with Durandal Breeze and Knockout for:

  • Enter data in the cells
  • Move easily between cells with arrow keys
  • Copy and paste values from/to excel
  • Export data to Excel/Pdf
  • Compatible in mobile devices

Solution

  • I can't make a comment and this is by no means a complete answer but here is a first attempt I worked up. for some reason you have to click the screen for the grid to appear : define(['knockout'], function (ko) { var ctor = function () {

        this.columns = 4
        this.rows = 4
        this.data = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 92, 93, 94], [7, 8, 9,]]
        this.init = function (view) {
    
    
        }
    
    };
    
    ctor.prototype.attached = function () {
        $('#example').handsontable({
            data: this.data,
            minSpareRows: 1,
            colHeaders: true,
            contextMenu: true
        });
    };
    ctor.prototype.activate = function (view) {
    
    };
    
    ctor.prototype.binding=function(view)
    {
       // this.init(view);
    }
    return ctor;
    });