- SPA_ARTICLE_CODE.zip
- SPA_ARTICLE_CODE
- ChainOfPluginsCompositionSample
- ComplexProductNavigationTest
- CompositionAndNavigationSample
- HierarchicalSPAWithNavigation
- ParameterizedPluginSample
- ParamNavigationTest
- SilverlightPluginSample
- SimpleCompositionSample
- SimpleProductNavigationTest
- SPA_POSTingObjectToServer
- SPAComplexObjectGetter
- SPAServerStringCommunications
- TwoPageOrdinaryHTMLApp
- TwoPageSPA
- TwoPageSPAWithNavigation
- TwoPageSPAWithTabs
- BPF.zip
- BPF
|
// BPF JavaScript library version 0.9
// (c) Nick Polyak 2012 - http://awebpros.com/
// License: Code Project Open License (CPOL) 1.92(http://www.codeproject.com/info/cpol10.aspx)
//
// short overview of copyright rules:
// 1. you can use this framework in any commercial or non-commercial
// product as long as you retain this copyright message
// 2. Do not blame the author(s) of this software if something goes wrong.
//
// Also as a courtesy, please, mention this software in any documentation for the
// products that use it.
/// <reference path="underscore.js" />
/// <reference path="ArrayExtensions.js" />
/// <reference path="StringExtensions.js" />
/// <reference path="SimpleEvent.js" />
/// <reference path="HashStrings.js" />
/// <reference path="NavigationNodeBase.js" />
var bpf = bpf || {};
bpf.nav = bpf.nav || {};
bpf.nav.FactoryNode = function (data, parentNode, childNodeProducingFunction) {
var _self = this;
var _data = data;
var _childNodeProducingFunction = childNodeProducingFunction;
bpf.nav.Node.call(_self, data, parentNode); // extend the class bpf.nav.NodeBase
_self.getOnSelectionChangedEvent().addSimpleEventHandler(function () {
var selectedKey = _self.getSelectedKey();
if (!selectedKey)
return;
addNodeIfNeeded(selectedKey);
});
var addNodeIfNeeded = function (key) {
var children = _self.getChildren();
if ((!children) || (!children.containsKey(key))) {
if (childNodeProducingFunction) {
var childNode = childNodeProducingFunction(key, _data);
if (!childNode)
return;
_self.addChildNode(key, childNode);
}
}
}
_self.select = function (key) {
if (_self.getSelectedKey() === key)
return;
_self.data.select(key);
addNodeIfNeeded(key);
};
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a software architect and a developer with great passion for new engineering solutions and finding and applying design patterns.
I am passionate about learning new ways of building software and sharing my knowledge with others.
I worked with many various languages including C#, Java and C++.
I fell in love with WPF (and later Silverlight) at first sight. After Microsoft killed Silverlight, I was distraught until I found Avalonia - a great multiplatform package for building UI on Windows, Linux, Mac as well as within browsers (using WASM) and for mobile platforms.
I have my Ph.D. from RPI.
here is my linkedin profile