jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Grid use with tree
Tagged: grid, tree column
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 6 months ago.
-
AuthorGrid use with tree Posts
-
Hi,
I am using grid with a tree column. By using the cellrenderer function
var treecolumn = function(row, columnfield, value, defaulthtml, columnproperties){ console.log(row); console.log(columnfield); console.log(value); var treeitem = value || [] ; if (treeitem.length == 0){ return '<div style="margin-top: 4px; margin-left:3px">No associated item</div>'; }else{ var detailById = []; var item = new Object(); //check null $.each( treeitem, function( key, value ) { var item = new Object(); item.label = value.label; detailById.push(item); }); var source = [ { label: "Associated item",expanded:true, items: detailById } ] console.log(source); console.log($("<div />").jqxTree({ source: source, width: '100%', height: 60}).html()); // Create jqxTree return $("<div />").jqxTree({ source: source, width: '100%', height: 60}).html(); } }
The tree column can be added to the grid, but it cannot expand. Is it require to add the expander or any setting I miss ?
Best Regards,
heimaxHi heimax,
Tree Column cannot be displayed within the Grid. It is not designed for such purpose. In addition, you cannot initialize a widget within the “cellsrenderer” callback. That function is designed to return only static HTML.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Thanks for the answer,
Any suggestion or advice for create the tree column in the grid?
Or can I use initeditor to initialize the tree widget?
Please help.
Best Regards,
heimax
Hi heimax,
The only suggestion I can give you is to use jqxTreeGrid.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.