This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Assuming: | |
* dataview is a { xtype: "list" } | |
* dataview.itemTpl includes a <div class="deleteplaceholder"></div> | |
* | |
* Delete button will disappear as soon as something is touched | |
*/ | |
dataview.on("itemswipe", function(dataview, ix, target, record, event, options) { | |
if (event.direction == "left") { | |
var del = Ext.create("Ext.Button", { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define("App.view.default.Card", { | |
extend: "Ext.List", | |
alias: "widget.defaultcard", | |
navigationBarItems: [ | |
{ | |
text: "Add", | |
align: "right", | |
eventName: "add" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// model | |
Ext.define("Person", { | |
extend: "Ext.data.Model", | |
fields: ["name", "parents", "renderered_parents"] | |
}); | |
// store | |
var Family = Ext.create("Ext.data.Store", { | |
model: "Person", | |
data: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flatten(input) { console.log(input); | |
var _flatten = (input, output) => { | |
console.debug("flattening %o", input); | |
return input.reduce((output, item) => { | |
if (typeof item == "object" && item instanceof Array) { | |
console.debug("flattening nested array %o", item); | |
return _flatten(item, output); | |
} else { | |
output.push(item); | |
return output; |