Skip to content

Instantly share code, notes, and snippets.

@JoeHetfield
JoeHetfield / NestedDataSource.js
Last active December 21, 2015 02:59
This is data source for fuelux's datagrid, which support nested property. property could nested in many level, until property path hit null or undefined, then the result will be "null" or "undefined". could be useful, I think.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore'], factory);
} else {
root.NestedDataSource = factory();
}
}(this, function () {
var NestedDataSource = function (options) {
this._formatter = options.formatter;
@alsoicode
alsoicode / gist:5381417
Last active December 16, 2015 04:59
On-Demand Ajax DataSource for FuelUX DataGrid
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore'], factory);
} else {
root.AjaxOnDemandDataSource = factory();
}
}(this, function () {
var AjaxOnDemandDataSource = function(options) {
this._formatter = options.formatter;
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),