Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Customizing Lanes in a Timeline

    I am trying to create a timeline very similar to the one shown in the showcase, but I would like to add a picture next to the Developer name in the leftmost column.

    Is it possible to customize the content of this column in the lanes?

    #2
    What's your version and build? And which Showcase sample do you mean?

    Short answer, yes you can - in 5.0, before you pass your Lane instances to Timeline.setLanes(), use Canvas.imgHTML() to generate HTML for the icon you want, and then update Lane.title to be imgHTML+title.

    Comment


      #3
      The version is: SmartClient Version: v10.0p_2015-01-02/Pro Deployment (built 2015-01-02)

      The images I want to show are stored on a database, and in the rest of the application I show them via a ViewFileItem in a Form. Is it possible to show a picture like that in the timeline lane field? I tried to create an extra lane field of type imagefile but I couldn't get it to show the picture.

      Code:
      ListGridField field = new ListGridField("pic", "Picture");
      field.setType(ListGridFieldType.IMAGEFILE);
                      
      timeline.setLaneFields(field, new ListGridField("title", "People", 150));
      
      ds.performCustomOperation("getLanes", null, new DSCallback() {
      
          @Override
          public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
      
              Record[] rs = dsResponse.getData();
              lanes = new Lane[rs.length];
      
              for(int i = 0 ; i < rs.length ; i++){
                  Record r  = rs[i];
                  Lane l = new Lane(r.getAttribute("name"), r.getAttribute("title"));
                  l.setAttribute("pic", r.getAttribute("pic"));
                  lanes[i] = l;
              }
      }
      Am I way off, or am I just missing something?

      Comment


        #4
        You can call DataSource.getFileURL() to get a URL that you can then use as a normal URL, for example, with a ListGrid field of type "IMAGE".

        Comment


          #5
          Yay! It's working! Thanks a lot.

          Have you had a chance to look at my other issue?
          http://forums.smartclient.com/showthread.php?t=32048

          Comment

          Working...
          X