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

    Timeline lane field style not working


    Is it possible to change the background color for the frozen fields of a specific lane in a Timeline? I tried setting the field style name attribute on the lane, however, it's still using the "labelColumn" base style.

    I am using the following:
    SmartClient Version: v12.1p_2022-12-29/Pro Deployment (built 2022-12-29)
    Chrome 108.0.5359.125 (Official Build) (64-bit)
    Firefox 108.0 (64-bit)
    Windows 10 Home

    Last edited by stonebranch3; 5 Jan 2023, 06:29.

    Three things here:

    1 - We've fixed Lane.fieldStyleName for tomorrow's builds - in the meantime, since Lanes are overlaid onto grid-rows, you should be able to use lane._baseStyle in your current build. However, note that this style will be applied to all cells in the lane's row, not just the frozen laneField-columns

    2) You can set laneField.baseStyle, but this will affect all cells in the laneField's column

    3) There's no direct Timeline method to style just the frozen cells in just certain lanes - to do that, you would need to override ListGrid APIs getCellStyle() or getCellCSSText() on the Timeline.timelineView autoChild.


      In fact, Lane.fieldStyleName is doc'd as only affecting lane-fields in the lane-row, and we've corrected the logic so this is now the case. Please retry with Lane.fieldStyleName in tomorrow's build, dated January 6 or later.


        Thanks, I will try this out once it's available.

        Setting the _baseStyle attribute works as you mentioned. I also tried lane.setStyleName, but this doesn't work.

        I'm currently creating the timelineView autochild from properties but wasn't sure how to override the getCellCSSText method since override points aren't supported by this mechanism according to the javadoc. Do I need to set the autochild constructor?

        Last edited by stonebranch3; 5 Jan 2023, 08:52.


          You're right - and, unfortunately, you can't directly override getCellCSSText() on a subclass applied with setAutoChildConstructor() either, in this case - you'd need to subclass TimelineView, which is an internal subclass of CalendarView.

          We may look at adding a Customizer for getCellCSSText(), while retaining its status as an override-point - it allows for simple CSS changes in general, without needing whole new style-sets.

          In the meantime, you should be able to achieve what you're looking for with Lane.fieldStyleName, in today's builds.


            That's what I figured since it wasn't working with a subclass of CalendarView. I was getting an error about setLanes not being defined.

            Lane.fieldStyleName is now working as expected.

            We have ListGrids that use getCellCSSText and we could use it with the Timeline as well if you decide to add a Customizer.



              We've added this customizer and you can try it out with ListGrid.setCellCSSTextCustomizer(), in builds dated January 8 or later. The override point should continue to work as expected on its own, but if you also install a customizer, the customizer will win.
              Last edited by Isomorphic; 7 Jan 2023, 03:20.


                It works great. Thanks!