This is a migrated thread and some comments may be shown as answers.

Change the color of parents and children in Gantt

1 Answer 137 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
bassam
Top achievements
Rank 1
Veteran
bassam asked on 27 May 2020, 10:27 PM

How to changes the color(background ) of Parent and children in the radGantt(Treelist View)?

 

1 Answer, 1 is accepted

Sort by
0
bassam
Top achievements
Rank 1
Veteran
answered on 16 Jun 2020, 10:09 PM

Thank you very much
The problem was solved

      <script type="text/javascript">
                function OnClientDataBound(sender, args) {

                    var gantt = sender._widget;
                    gantt.element.find(".rgtTreelistContent table tr ").each(function (e) {
                        var dataItem = gantt.dataSource.getByUid($(this).attr("data-uid"));                  
                        // colorize task per business requirements
                        if (dataItem.wBS_Activity == 1) {
                            this.style.backgroundColor = "#f99";
                        } else {
                            this.style.backgroundColor = "#9f9";
                        }
                        this.style.backgroundImage = 'none';
                    });
                }
               
        </script>

Tags
Gantt
Asked by
bassam
Top achievements
Rank 1
Veteran
Answers by
bassam
Top achievements
Rank 1
Veteran
Share this question
or