function PatternVM() {
    var self = this;
    
    /*
     *  Members
     */
    self.pattern = ko.observable();

    /*
     *  AJAX
     */

    // Fetch pattern from DB (if id == 0 then insert else update)
    self.getPattern = function( id ) {
        if ( id > 0 ) {
            console.log( "getPattern " + id );
            $.getJSON( "/api/pattern/" + id, function( pattern ) {
                self.pattern( new Pattern( pattern ) );
            }); 
        } else {
            self.pattern( new Pattern() );
        }
    };

    // TODO implement functions
    self.save = function() {}
    self.delete = function() {}
    self.tabNext = function() {}
    self.insertTabUnder = function() {}
    self.insertTabOver = function() {}

}
// View Model used by Knockout JS
View Model used by Knockout JS
View Model used by Knockout JS
function PatternVM() {
    var self = this;
    self.pattern = ko.observable();
    self.getPattern = function( id ) {
        if ( id > 0 ) {
            console.log( "getPattern " + id );
            $.getJSON( "/api/pattern/" + id, function( pattern ) {
                self.pattern( new Pattern( pattern ) );
            }); 
        } else {
            self.pattern( new Pattern() );
        }
    };
    self.save = function() {}
    self.delete = function() {}
    self.tabNext = function() {}
    self.insertTabUnder = function() {}
    self.insertTabOver = function() {}
}
function PatternVM ( ) { var self = this ; self . pattern = ko . observable ( ) ; self . getPattern = function ( id ) { if ( id > 0 ) { console . log ( "getPattern " + id ) ; $ . getJSON ( "/api/pattern/" + id , function ( pattern ) { self . pattern ( new Pattern ( pattern ) ) ; } ) ; } else { self . pattern ( new Pattern ( ) ) ; } } ; self . save = function ( ) { } self . delete = function ( ) { } self . tabNext = function ( ) { } self . insertTabUnder = function ( ) { } self . insertTabOver = function ( ) { } }
View Model used by Knockout JS
View Model used by Knockout JS
/*
     *  Members
     */ /*
     *  AJAX
     */ // Fetch pattern from DB (if id == 0 then insert else update) // TODO implement functions