Home Forums FlexGanttFX add data in new columns created in flexganttfx and change the activity color

Tagged: 

Viewing 5 reply threads
  • Author
    Posts
    • sainera
      Participant
      Post count: 3
      #13954 |

      I have created column in Flexganttfx, but is unable to put data in it.
      Also, I am trying to change the activity color in flexganttfx. Is it possible?
      Please help me out.

    • Dirk Lemmermann
      Keymaster
      Post count: 78
      #13955 |

      The left-hand side of the Gantt chart is a regular TreeTableView of JavaFX. Nothing really special about it. Just make sure your model class extends “Row”. Then add properties to add and matching columns to the table view. Did you do that? This is basic JavaFX coding, not FlexGanttFX-specific.

      Activities are drawn by renderers. You have to register your own renderer to customize the appearance of your activities. See also: https://flexgantt.atlassian.net/wiki/spaces/FFXMAN/pages/491747/3.4.6+Activity+Rendering

    • sainera
      Participant
      Post count: 3
      #13971 |

      I did that, but it doesn’t seems to be working.
      Here is my code:
      class WorkPackages extends Row<WorkPackages, WorkPackages, Pack> {
      private String name;
      private double resource;

      public WorkPackages(String name,double resource) {
      setName(name);
      setResource(resource);
      }
      public void setResource(double resource) {
      this.resource=resource;
      }
      public double getResource() {
      return this.resource;
      }
      }
      }

      Only the name column is getting populated with the values.`

    • Dirk Lemmermann
      Keymaster
      Post count: 78
      #13972 |

      And how do you create the table column?

    • sainera
      Participant
      Post count: 3
      #13973 |

      I have read one of your forum questions and followed the same thing to create a column
      TreeTableView table=gantt.getTreeTable();
      table.getColumns().add(new TreeTableColumn(“Resources”));

      After that, in order to add data in the table, I am writing the following code
      WorkPackages ac = new WorkPackages(packageName,resources);

    • Dirk Lemmermann
      Keymaster
      Post count: 78
      #13974 |

      You also have to set a cell “value” factory on the tree table column. How should the column know how to retrieve the values for its cells? The text “Resources” in “new TreeTableColumn(“Resources”)” is just the column title.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.