lukemurray / nghierarchicalselector Goto Github PK
View Code? Open in Web Editor NEWA Hierarchical/Tree Selector control for AngularJS
Home Page: http://lukemurray.github.io/NgHierarchicalSelector/
License: MIT License
A Hierarchical/Tree Selector control for AngularJS
Home Page: http://lukemurray.github.io/NgHierarchicalSelector/
License: MIT License
Hello,
It would be nice to have the option to set a placeholder in the dirrective.
I don't know how to deal with it as you use templateCache.
Can you give me a hint ?
Thank you
How do I reset the selection field empty?
I'd like to make the field empty after selection is complete. But until I don't refresh the page, I'm not able to remove the selected item from the selection field.
I'm trying to embed this to a SharePoint webpart control however the control is causing the page to refresh everytime. Is there anyway to prevent it posting back?
Hi!
I just discover this awesome directive, amazing, you save my day!
I was wondering if there is any default attribute to set this type of field as required?
Thanks in advance!
typo in the link for the demo : http://lukemurray.github.io/NgNierarchicalSelector/ instead of http://lukemurray.github.io/NgHierarchicalSelector/
i am facing some problems with asyncData as hierarchical selector is populating with no data.
[{"id":987,"name":"AP","children":[]},{"id":978,"name":"MP","children":[]},{"id":992,"name":"UP","children":[]},{"id":997,"name":"HP","children":[]},{"id":1007,"name":"AAP","children":[]}]
I am using the same example with different data as below:
we have some services to get for cities in each and every object of above array
html:
jS:
$scope.loadAsyncData = function(parent) {
var defer = $q.defer();
if (!parent) {
$http.get("api/.....myservicecall").success(function (data) {
data = data.List;
for (var i = 0; i < data.length; i++) {
data[i].hasChildren = true;
}
defer.resolve(data);
});
}else{
$http.get("api/....myservicecall?id="+parent.id).success(function (data) {
data = data.List;
for (var i = 0; i < data.length -1; i++) {
data[i].hasChildren = true;
}
defer.resolve(data);
}).error(function (data){
});
}
i totally understand with assigning data="data". but i am not able to understand how it will load with async data..
Please help me out on this .. or any where i can get document regarding asyncdata loading
@lukemurray on GlobaLeaks we are evaluating the use of NgHierarchicalSelector inside our form builder to make possible for a user to select options from a hierarchic select-box like the one implemented by NgHierarchicalSelector (globaleaks/GlobaLeaks#1408).
we would have the need to deal with long lists and i'm wondering how this would impact not only from a performance point of view but mostly from the user experience point of view;
suppose in fact that one loads a very long list and has to scroll down a lot to find the element he would like to click. have you ever dealt with such a requirement and what would be your suggestion?
I need to be able to select the values output into the selection as well as set which property should be used as "children".
Something like this would be stellar:
<hierarchical-selector
ng-items="location.name for location in locations"
ng-children="dependents"
ng-model="model.location" />
It's not easy to adhere to your id, name, children structure without jumping through hoops to save the selection properly.
When I tried to run the demo, I saw there was missing this file
Even if tabindex="0"
is added to the hierarchical-input, it doesn't seem to allow Enter
to open the tree view. Once the tree view is open (via mouse click), there are keyboard actions to navigate the tree ok.
As it is, this widget is not accessible at all because you can't get to the initial state to open the tree via keyboard.
I am facing an issue when i bind selection and onSelectionChanged to same scope variable. For Example,
<hierarchical-selector id="product"
class="tree-browser"
ng-model="searchModel.products"
data="productHierarchy"
on-selection-changed="searchModel.products = items"
multi-select="true"
selection="searchModel.products"
no-button/>
I am using selection to display default selected values when page loads for the first time. When user manually changes the selected nodes on the tree, itemSelected is called which calls onSelectionChanged. The watch on selection is triggered as both are bound to same variable. This in turn calls itemSelected and so on. The code goes into an infinite loop and the web page freezes. Is there a solution to the problem?
When I try to set the selection on a multi-select, the only way that I can find to get the checkboxes to be correctly checked as well as the preselected items to show up in the box when the form renders is to set both the selection as well as meta information in the data. Is there a better way?
areas.controller("areaAddTypeController", ['$scope', '$state', function($scope, $state) {
....
$scope.selection = [{id: 1, name: "Country"}];
$scope.areaTypes = [{id: 1, name: "Country",_hsmeta: {selected:true}}, {id: 2, name: "Province"}, {id: 3, name: "Cluster"}];
....
}]);
tag:
<hierarchical-selector multi-select="true" data="areaTypes" on-selection-changed="updateItems(items)" selection="selection" />
Says it all. It should scroll the next items into view
The tags go onto the next line but the input control doesn't change size.
I can't docs or an example that shows how to enable searching or auto-complete of the treeview?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.