Skip to content

Instantly share code, notes, and snippets.

@josebalius
josebalius / evaluator.js
Last active January 15, 2016 18:10
Conditions
var conditions = [
{
column: "name",
operator: "=",
value: "John"
},
{
join: "OR"
},
{
@josebalius
josebalius / flatten.js
Last active May 18, 2016 13:59
Recursive
var arr = [
1,
[2, 3],
[3, [4, 5]]
]
var flatten = function(arr) {
// Implement this function
}
@josebalius
josebalius / array.js
Last active January 15, 2016 19:46
Array Performance
var arr = [
{
name: "John",
age: 20
}, {
name: "Ally",
age: 25
}, {
name: "Jordan",
age: 30
@josebalius
josebalius / cellOptions.js
Created June 8, 2014 23:45
ngReactGrid - Cell options
{
field: "", // prop key on the object, ie: {firstName: "John"}, your field would be "firstName"
displayName: "", // this is the label that the grid will display on the column headers,
render: function() {}, // use this function when you want a custom cell. It must return a string or React component
sort: true, // this controls whether the grid allows sorting on this cell or not, default is true, set to false to disable
width: "10%" // the default is 10%
}
@josebalius
josebalius / example_customCells.html
Created June 8, 2014 23:40
ngReactGrid - Custom Cells
<!DOCTYPE html>
<html ng-app="example">
<head>
<title>ngReactGrid Basic Example</title>
<link rel="stylesheet" type="text/css" href="css/ngReactGrid.css">
</head>
<body>
<div ng-controller="BasicExampleController" style="width: 100%">
<ng-react-grid grid="grid"></ng-react-grid><br />
@josebalius
josebalius / ngReactGridOptions.js
Created June 1, 2014 21:45
ngReactGrid - Setup options
{
// Properties you can set
columnDefs: [],
data: [],
height: 500,
localMode: true,
/**
* Use this function when setting localMode = false,
* it will be called for every change in page size, sort, search, or pagination.
@josebalius
josebalius / example_serverSide.html
Created June 1, 2014 21:29
ngReactGrid - Server side
<!DOCTYPE html>
<html ng-app="example">
<head>
<title>ngReactGrid Basic Example</title>
<link rel="stylesheet" type="text/css" href="css/ngReactGrid.css">
</head>
<body>
<div ng-controller="BasicExampleController" style="width: 100%">
<ng-react-grid grid="grid"></ng-react-grid>
@josebalius
josebalius / example_horizontalScroll.html
Created May 29, 2014 21:54
ngReactGrid - Horizontal Scroll
<!DOCTYPE html>
<html ng-app="example">
<head>
<title>ngReactGrid Basic Example</title>
<link rel="stylesheet" type="text/css" href="css/ngReactGrid.css">
</head>
<body>
<div ng-controller="BasicExampleController" style="width: 100%">
<ng-react-grid grid="grid"></ng-react-grid>
@josebalius
josebalius / example_basic.html
Last active August 29, 2015 14:01
ngReactGrid - Basic
<!DOCTYPE html>
<html ng-app="example">
<head>
<title>ngReactGrid Basic Example</title>
<link rel="stylesheet" type="text/css" href="css/ngReactGrid.css">
</head>
<body>
<div ng-controller="BasicExampleController" style="width: 100%">
<ng-react-grid grid="grid"></ng-react-grid>
@josebalius
josebalius / example.html
Last active August 29, 2015 14:01
How to use ngGrid - Add to HTML
<!DOCTYPE html>
<html ng-app="example">
<head>
<title>ngReactGrid Basic Example</title>
<link rel="stylesheet" type="text/css" href="css/ngReactGrid.css">
</head>
<body>
<!-- Your JS Sources -->
<script src="js/angular.min.js" type="text/javascript" ></script>
<script src="js/react-0.10.0.js" type="text/javascript" ></script>