We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ejTreeGrid Questions

I'm trying to see if the ejTreeGrid is something feasible for me to use.

On load, only the root parents are loaded and are collapsed.

http://js.syncfusion.com/demos/web/#!/bootstrap/treegrid/defaultfunctionalities

In the example above, only "Planning", "Design", and "Implementation Phase" are loaded. Then when you click on "Planning", it's children are retrieved and displayed on the tree grid.

Is this possible? Examples?

7 Replies

CH Christopher Hui February 10, 2017 01:27 AM UTC

Also, is there a way to define a commands column, similarly to ejGrid?


JS Jonesherine Stephen Syncfusion Team February 10, 2017 06:18 PM UTC

Hi Christopher, 
Thanks for contacting Syncfusion support. 
Query1: n the example above, only "Planning", "Design", and "Implementation Phase" are loaded. Then when you click on "Planning", its children are retrieved and displayed on the tree grid. 
Solution: By using “enableCollapseAll” property we can render the TreeGrid with all row collapsed during load time.  
Please find the code example below: 
   $(function () { 
            $("#TreeGridContainer").ejTreeGrid({ 
                enableCollapseAll: true,                 
            }); 
 
        }); 
We have also prepared the sample for your reference. Please find the sample below location:  
Query2: Also, is there a way to define a commands column, similarly to ejGrid? 
Solution: 
At present there is no support for commands column in ejTreeGrid. Hence we have logged a Feature report “Support for command column in TreeGridThis feature can be tracked through our Feature Management.  
It will be implemented in any of our upcoming main release.  
Please let us know if you require further assistance on this.
Regards, 
 
Jone sherine P S  



CH Christopher Hui February 10, 2017 06:30 PM UTC

Thanks for the information about the enableCollapseAll.

To reiterate, I do not want to load the entire hierarchy structure. On load, I only want to load the roots, then when a parent node is clicked, an API call is made (preferably in the form of a callback function) to retrieve it's children and those children will be added under the node that was clicked.

Is doing something like that possible?


CH Christopher Hui February 10, 2017 09:29 PM UTC

Another followup question, if I set allowDragAndDrop to true, is there a way I can invoke a callback function after the item is "dropped"?


JS Jonesherine Stephen Syncfusion Team February 11, 2017 05:48 AM UTC

Hi Christopher, 
Please find the response below: 
Query1: To reiterate, I do not want to load the entire hierarchy structure. On load, I only want to load the roots, then when a parent node is clicked, an API call is made (preferably in the form of a callback function) to retrieve its children and those children will be added under the node that was clicked. 
Solution: At present there is no support to load the child elements in Tree Grid on demand. Hence we have logged a feature report “Support for load on Demand for Tree Grid”. It will be implemented in any of our upcoming main release.  
Query2:  if I set allowDragAndDrop to true, is there a way I can invoke a callback function after the item is "dropped"? 
Solution: In TreeGrid “rowDragStop” client side event will be triggered after dragged item gets dropped. 
Please find the code example below: 
            $("#TreeGridContainer").ejTreeGrid({ 
                rowDragStop: function (args) { 
                    //we can perfrom the required action here 
                    alert("row dropped") 
                } 
            }); 
Please find our online documentation for client side events available during row drag and drop action 
We have also prepared the sample for your reference. Please find the sample from below location 
Please let us know if you need further assistance on this. 
Regards, 
Jone sherine P S 



CH Christopher Hui February 15, 2017 05:44 PM UTC

is there a way to detect whether a click on a node is single click or double click?


JS Jonesherine Stephen Syncfusion Team February 16, 2017 03:57 PM UTC

Hi Christopher, 
For record single click action “recordClick” event will be triggered whereas for double click/editing action “beginEdit” event will be triggered in Tree Grid. 
Please find the code example: 
$("#TreeGridContainer").ejTreeGrid({                 
                recordClick: function (args) { 
                    //Triggered on single click action 
                    console.log("recordClicked"); 
                }, 
                beginEdit: function (args) { 
                    //Triggered on double click action 
                    console.log("double click"); 
                }, 
            }); 
We have also prepared the sample based on this. Please find the sample from below location 
Regards, 
Jone sherine P S 


Loader.
Live Chat Icon For mobile
Up arrow icon