Skip to content

Commit

Permalink
updated octagrid app
Browse files Browse the repository at this point in the history
  • Loading branch information
bakamaru committed May 8, 2017
1 parent d82f7cb commit 45d8291
Show file tree
Hide file tree
Showing 10 changed files with 25,924 additions and 3,323 deletions.
11,403 changes: 11,403 additions & 0 deletions dist/formbuilder/formbuilder.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/formbuilder/formbuilder.bundle.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/octagrid.min.js.map

This file was deleted.

11,103 changes: 11,103 additions & 0 deletions dist/octagrid/octagrid.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/octagrid/octagrid.bundle.js.map

Large diffs are not rendered by default.

6,652 changes: 3,330 additions & 3,322 deletions dist/octagrid.min.js → dist/trainingapp/trainingapp.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/trainingapp/trainingapp.bundle.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions myapp/kjsmodule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"octagrid":"./octagrid/Grid.ts"
}
39 changes: 39 additions & 0 deletions myapp/trainingapp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { OctaGrid } from "../octagrid/Grid";
import { BootstrapFormBuilder } from "../octagrid/BootstrapFormBuilder";
import * as $ from 'jquery-validation'


var metadata = '{"TrainingId":{"input":"number","grid_header_type": "checkbox","isdependent":false,"primary":true,"rules":{}},"Name":{"input":"text","isdependent":false,"primary":false,"rules":{"required":true}},"Description":{"input":"textarea","isdependent":false,"primary":false,"rules":{}},"Syllabus":{"input":"editor","isdependent":false,"primary":false,"rules":{}},"Career":{"input":"editor","isdependent":false,"primary":false,"rules":{}},"DateFrom":{"input":"datepicker","isdependent":false,"primary":false,"rules":{}},"DateTo":{"input":"datepicker","isdependent":false,"primary":false,"rules":{}},"Time":{"input":"text","isdependent":false,"primary":false,"rules":{"required":true}},"IsPopular":{"input":"checkbox","isdependent":false,"primary":false,"rules":{}},"IsRunning":{"input":"checkbox","isdependent":false,"primary":false,"rules":{}},"IsActive":{"input":"checkbox","isdependent":false,"primary":false,"rules":{}},"AddedOn":{"input":"hidden","isdependent":false,"primary":false,"rules":{}},"IsDeleted":{"input":"hidden","isdependent":false,"primary":false,"rules":{}}}';
var mdta = JSON.parse(metadata)
var formbuilder = new BootstrapFormBuilder({
renderAt: "#formhere",
showVertical: false,
model: 'brand',
makeColumn: 2,
metadata: JSON.parse(metadata)

});
var options = {
show: ['TrainingId', 'Name', 'Description'],
hideColumns: ['AddedBy', 'IsDeleted'],
// searchBox: "#txtSearch",
showAddNewButton: true,
metadata: JSON.parse(metadata),
model: 'brand',
containers: {
listContainer: $("#dvlist"),
formContainer: $("#formhere"),
paginationContainer: $("#pagehere"),
itemperpage: $("#ddlItemsPerPage")
},
enableForm: true,
formBuilder: formbuilder
};
var grid = new OctaGrid(options);

grid.renderGrid($("#tbltest"));
if (options.enableForm) {
options.formBuilder.renderForm();
options.formBuilder.setGrid(grid);
//grid.setForm(options.formBuilder);
}
44 changes: 44 additions & 0 deletions try.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {

if( dir[dir.length-1] != '/')
dir=dir.concat('/')

var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
// build regex search
var re = new RegExp(/\entry.(json)/g);
if( re.test(file) ) {
console.log(file);
filelist.push(dir+file);
}
}
});
return filelist;


};
var getAppEntries=function(dir){

var files=walkSync(dir);
//var parsedJSON = require(x);
var mergeJSON = require("merge-json") ;
var result={};
files.forEach(function(file) {
var json= require(file);
//console.log(json)
result = mergeJSON.merge(result, json) ;
//console.log(result) ;
});
return result;
}

var x=getAppEntries(__dirname);
console.log(x.x)
console.log(12)

0 comments on commit 45d8291

Please sign in to comment.