Search Posts

Category: treeview

Create parent child json object to show in angularjs

I have a json object of structure [ {GroupName:”Test1″,Name:”A/B”,Count:12,Value:”B”}, {GroupName:”Test1″,Name:”A”,Count:12,Value:”A”}, {GroupName:”Test1″,Name:”A/B/C”,Count:12,Value:”C”}, {GroupName:”Test1″,Name:”A/B/D”,Count:12,Value:”D”}, {GroupName:”Test2″,Name:”E/F”,Count:12,Value:”F”}, {GroupName:”Test2″,Name:”E/F/G”,Count:12,Value:”G”}, ] Now based on the “/” value i need to create below structure to show in ng-repeat.It is required to create a tree view menu. The values i.e A/B/C is not fixed and it could be multiple also the name values are not squential i.e E/F can be the next value then again A/B/C [ { Name: Test1, Child:[ {Name: A, […]

Treeview doesn’t work well in angularjs

My purpose: I want to show treeview data in table. I use Angularjs and treeview to realize this feature. However, when the JS script get the data and give the data to treeview, the data will show for just a second and disappear. html code like this: <tbody id=”understanding-content-table-body”> <tr ng-repeat=”(i, log) in understandingLogs”> <td ng-repeat=”item in log track by $index”>{{item}}</td> <td> <div id=”tree-{{i}}”></div> </td> </tr> </tbody> And my JS code like this: for (var […]

angularjs tree view is not working getting module error

I am trying to use angularjs for creating tree view and I am getting module error. I am trying to follow this link I followed the steps added the js and css file in the html added the <div data-angular-treeview=”true” data-tree-id=”abc” data-tree-model=”treedata” data-node-id=”id” data-node-label=”label” data-node-children=”children”> </div> then in controller var CIController = angular.module(‘CIController’, [‘ngMaterial’, ‘ngAnimate’, ‘ngAria’, ‘ngMessages’, ‘Alertify’, ‘ngFileUpload’, ‘angularTreeview’,]) $scope.treedata = [ { “label”: “User”, “id”: “role1”, “children”: [ { “label”: “subUser1”, “id”: […]

Implementing lazy loading treeview with AngularJS

I need a treeview with AngularJS that is able to fetch data by lazy loading and also has a search feature by lazy loading. According to the user input into the search textbox, I want the treeview to be initialized. For part one of this question: I mean lazy loading treeview. I use this theory: at first time loading treeview only with the most root node: <div class=”input-group”> <span class=”input-group-addon”><i class=”glyphicon glyphicon-search”></i></span> <input type=”text” id=”txtSearch” […]

Dropdown Treeview with search

I want to show a tree view in a drop-down that user can search in a tree. also, I use angular 1.x in the project. How can I do that? I saw some controls like or but they don’t have search and data-source are not compatible with mine. I want something like this: DropDown Tree View Does anyone know another library? Source: AngularJS

How to put alert before check-uncheck a kendo checkbox

So if a user wants to check a checkbox, it will prompt a dialog if he/she have rights to tick-untick. So when he don’t have rights, the state will stay the same. I am using angularjs with kendo treeview. $scope.options = { checkboxes: { checkChildren: true, }, loadOnDemand: false, check: onCheck, dataSource: $scope.treeData, template: ‘{{ dataItem.text}}’, schema: { model: { children: “List” } } function onCheck(e) { var currentItem = e.sender.dataItem(e.node); console.log(currentItem.rights); //if currentItem.rights= ‘0001’ […]

Converting sql to Treeview JSON with C#

I got a stored procedure fetching this table. I want to format it like this: data: [ { text: “Furniture”, items: [ { text: “Tables & Chairs” }, { text: “Sofas” }, { text: “Occasional Furniture” } ] }, { text: “Decor”, items: [ { text: “Bed Linen” }, { text: “Curtains & Blinds” }, { text: “Carpets” } ] Having trouble in converting it to JSON using my stored proc. Output is in kendo-tree-view […]

Angularjs directive treeview from json data

I must say, directive is very week topic of mine in matter of angularjs. I am trying to make tree view from jsondata which is as below but not able to figure out how to make with special need. Here is my json object, { “declaration”: { “attributes”: { “version”: “1.0”, “encoding”: “UTF-8” } }, “elements”: [ { “type”: “element”, “name”: “MyRootNode”, “attributes”: { “id”: “MyRootNodeID”, “version”: “1.2”, “properties”: “2.6” }, “elements”: [ { “type”: […]

Get complete Hierarchy from selected node from angular treeview

I want to show breadcrumbs when node is selected,but can’t get complete hierarchy from selected node. for eg: if i select node subuser2-1-1 then i want User->subUser2->subuser2-1->subuser2-1-1 Any suggestions would be appreciated. Please check this fiddle .directive(“treeModel”, function($compile) { return { restrict: “A”, link: function(a, f, b, scope) { var d = b.treeModel, g = b.nodeLabel || “label”, c = b.nodeChildren || “children”, h = ‘<ul class=”repUL”>’; h = h+'<li data-ng-repeat=”node in ‘ + d […]

How to create dynamic tree structure left menu angularjs

I need to create dynamic tree structure left menu in my web app using angular js from json response. I achieved this with the help of ng-repeat with the limitation of 3 levels – Level 1 -> Parent(Category), Level 2 -> child(subcategories), Level 3 -> child of child(subcategories). Now, I want ‘n’ no. of levels without restriction. There is an option to create a category as parent and can create sub category under that parent. […]

Next Page »