Skip to content

Instantly share code, notes, and snippets.

@mbeard
mbeard / RepeaterStaticDataSource.js
Last active August 29, 2015 14:10
static datasource example for Fuel UX Repeater
// static datasource for repeater
function StaticRepeaterDataSource(columns, data) {
var columns = columns;
var dataset = data;
var sort = function(data, sortProperty, sortDirection) {
var sortedData = _.sortBy(data, function(item) {
return item[sortProperty];
});
@mbeard
mbeard / TreeStaticDataSource.js
Last active August 29, 2015 14:10
static datasource example for the Fuel UX tree control
// static datasource for tree
function StaticTreeDataSource(data, foldersOnly) {
var nodes = data;
var nodeId = 0;
var folderSelect = (foldersOnly === true);
var rootNodesRendered = false;
var delay = function() {
var min = 200; // 200 milliseconds
var max = 1000; // 1 second
@mbeard
mbeard / fuelux-repeater-dynamic
Created November 4, 2014 19:13
Example of the Fuel UX repeater bound to a dynamic datasource (backed by an API).
<!DOCTYPE html>
<html class="fuelux">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Snippets</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- dependencies -->
@mbeard
mbeard / fuelux-repeater-static
Last active November 19, 2015 13:52
Example of the Fuel UX repeater bound to a static datasource (manipulated using underscore).
<!DOCTYPE html>
<html class="fuelux">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Snippets</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- dependencies -->