jQuery UI Widgets › Forums › TreeGrid › JQX Tree grid hide column on left
Tagged: hide columns, tree grid
This topic contains 5 replies, has 2 voices, and was last updated by Martin 6 years, 3 months ago.
-
Author
-
Hi,
Can I hide and show the leftmost column dynamically on a jqx tree grid?
When I say hidden = true, the column value is hiding but the column and the header are still showing up….maybe because the tree grid has to show the indentation and the hierarchy over there? Is there a way that I can make this work? Show the hierarchy on the 2nd column (next to the leftmost column) when the leftmost is hidden and then show it on the leftmost when the column is showing.Thanks,
Indu.Hello Indu,
Yes, it is possible.
Please, look at the following Example.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/Thank you so much for your reply…I was able to implement it.
One more question:-
If I want to partially edit the left most column…the indentation and everything should be there….but the data in the cell should change in some cases and not, depending on the value of the row (var row = $(“#jqxtreeGrid”).jqxTreeGrid(‘getRow’, rowkey);)….is there a way I can access the html of the cell in createEditor event? We have rowkey, cellvalue, editor, celltext, width and height as parameters…but not the cell html value. If I can access the html, then I can just return the html as-is without any changes in cases where I don’t want to change the look of the cell.Thanks,
Indu.Hello Indu,
You can get the html of a cell using
document.querySelector
inside thecreateEditor
callback.
You know the row id from therowkey
parameter, so you can usedocument.querySelector("[data-key='"+ row +"']").children[colId];
.
Here is an Example.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/Thank you!!! That does help.
Only follow up question I have is:- if I want html of the editing cell before the editor is added, in which event should I use the document.querySelector in?Thanks,
Indu.Hello Indu,
You could use the
rowClick
event for such case. As then the editor is not created yet.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.