Jqgrid tree grid - displaying radio off icon for last child node - jqgrid

I am loading data for child nodes from server side on expanding the row. I wanted to display the 'ui-icon-radio-off' icon for children at the last level, currently it is displaying downward triangle as I set loaded: true, expanded: true. Is it possible to change this icon to 'ui-icon-radio-off' as shown in the attachment below...

I suppose that the problem is the data which you used to fill the tree grid. The data should include the values of hidden columns. The column isLeaf defines whether the row is a tree node or a leaf. The rows which has isLeaf: true will be displayed with 'ui-icon-radio-off' icon.
You can find more details and example here, here, here or for example here.

Related

Adding tooltip to rows in treeview in gtkmm

I am using a Gtk::TreeView to create a tree view in gtkmm. It has two columns. The first column has two types of icons in different rows. One icon is used to add an element to the tree and the second is used to delete the element from the tree.
I have accessed the column number of the first column and added tooltip to the icons. However, I need different tooltips for both the icons.
A variable COL_ADD is used to compare the column using:
if (col == _tree.get_column(COL_ADD-1)) {
set_tooltip_text(_("Add selection to set"));
}
where col is Gtk::TreeViewColumn.
Since both the icons belong to same column, so they are getting the same tooltip. How do I differentiate to get the corresponding rows of icons to add different tooltips to them?
I guess that Gtk::TreeView::set_tooltip_cell() is what you need:
https://developer.gnome.org/gtkmm/stable/classGtk_1_1TreeView.html#ae7cc8fde03c481de81fc9d13e34bff98

kendo ui tree - how to show only part of the nodes

I have hierarchical data for the tree and I want to show only part of the leaves and later to add more leaves to the tree when a button is clicked for example.
One solution I thought of is to remove all unnecessary items from the data and to add items to the data when I want to add them to the tree view.
I wonder whether there is another solution without adding/removing items from/to the data?
You can filter the data source or hide some of the .k-item elements with jQuery.

Selecting checkbox in Kendo UI Treeview

I am using Kendo UI tree view with checkboxes. My problem is when i am loading the tree i will be checking some checkboxes using javascript. But this is not selecting parent checkbox automatically. Do i need to do this manually or is there any option in the framework.
Thanks,
Raja
Lets assume that you want to select the node that is selected:
// Get the node that is selected
var selected = treeview.select();
// Find the checkbox associated with this node
var checkbox = $("input[type='checkbox']", selected)[0];
// Click on it for selecting it and its ancestors
checkbox.click();
Being treeview the result of creating kendoTreeView:
var treeview = $("#my_tree").kendoTreeView({...}).data("kendoTreeView");
If you check the nodes by adding the 'checked' attribute with JavaScript
e.g.
$('input').attr('checked','checked')
you will need to handle the parent checking manually. However if you simulate click the TreeView will update its state as it would do if you have used the mouse to click.
e.g.
$('input').click();
Keep in mind you need to call the click on the checkbox input not the span element wrapping it.
Kendo ui (html5) treeview the position is reset to the begining of the tree.
when i bind the many records in the tree . when i select the last node the treeview position is reset to the begining of the tree.
This problem arises only in IE(Internet Explorer 9). in firefox and chrome it is working fine .
The image 1 shows the page that treeview reset to begining of the tree after selecting the tree node at the last record.
the image 2 shows the page that treeview node is selected at the botom

How to NOT display certain nodes in outline view?

In Apple's Mail app, in the outline view on the left, an inbox or a folder is shown in hierarchy but the emails in the folder or email is not shown at all.
I would like to reproduce this feature.
I have an outline view connected to a tree controller. Objects (nodes) are added to the tree controller and displayed in the outline view. How can I prevent some objects from appearing? Specifically, I have folder nodes that contain instances of a custom object. Just as in Mail.app, I would like to only display the folder in the outline view and will have the custom objects displayed in another view.
Some controller code as per request; here I am adding nodes to a folderNode that is selected in the outline view:
indexPath = [treeController selectionIndexPath];
indexPath = [indexPath indexPathByAddingIndex:[[[[treeController selectedObjects] objectAtIndex:0] children] count]];//want to insert the new node at the end of the folder node's array of children
...
[treeController insertObject:customObjectNode atArrangedObjectIndexPath:indexPath];
NSLog(#"No. of items selected in tree controller/outline view is %i",[[treeController selectedNodes] count]); //if the folderNode is a leaf, this gives 0, i.e. no selection
// if the folderNode is not a leaf, the added child automatically becomes selected by NSOutlineView. In that case I keep its parent selected (the folder) so the next customObjectNode can be added
[self selectParentFromSelection];//however this method will then do nothing because at this point nothing is selected. Now this whole paragraph of code cannot be repeated because nothing is selected so the first line of code doesn't work.
Are you using any other tree controllers which need to continue on to the children?
If not, just have the folder nodes return YES to -isLeaf (and nil for the childNodes key).

Example of jqGrid TreeGrid that loads node children from JSON service on expand

The base problem is I have a TreeGrid that I has a significant number of nodes (over 6k) and I want to be able to load a branch when the user expands a node rather than loading all at once.
I know this is possible in jqGrid (the documentation indicates so just very poorly worded http://www.trirand.com/jqgridwiki/doku.php?id=wiki:adjacency_model ) but what I can't figure out is the precise set of jqGrid settings I need to make it do that.
I do have a functional TreeGrid that will load all records from the 'url' parameter, so the only trick I need is for it to only load the top node alone, and then load it's children when I click the ExpandRow.
Figured it out myself:
The first key is setting loaded=false in the child nodes I don't want loaded. Then I need to respond the request jqGrid sends on unloaded nodes with the right nodes.

Resources