Announcement

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

    Custom column header names for ListGrid

    Hi Isomorphic,

    At user requests we are trying to add the possibility to change the column header names for a set of columns in ListGrids instead of using static names. More exactly we have a set of Data 1 ... Data 10 text columns that users could use to customise them: both their header names and the values from the records.

    But the usual mechanism with data sources and records does not seem to be possible in this case as there is no support for this... Can you please point us in a direction on how we could best implement this mechanism? Feedback from other developers(in case you have such functionality) is also very much appreciated!

    Thank you

    #2
    Hi slick07,

    we had this programmed for us as a feature sponsorship in 12.1 in 2018, see here.
    This was the thread leading to this, also discussing other possibilities.

    Best regards
    Blama

    Comment


      #3
      Hi Blama and thank you for the feedback. What you are suggesting I think it is different from what we need... We do not care about Locale. We just have a few columns that the users could customise them as they want. More exactly all we would need is to be able to update DataSourceField.setTitle() and this change to be reflected within the interface. But the change is not reflected...

      Comment


        #4
        Hi slick07,

        it does not matter why you do want to derive from normal processing - i18n or custom stuff.
        What's important for you is that DataSourceLoader returns dynamic content - and this is how you do that.

        Best regards
        Blama

        Comment


          #5
          Aside from DynamicDSLoader, DataSources that only need client-side functionality can also be constructed on-the-fly on the client at any time.

          So, while DataSources cannot be modified after construction (this would lead to lots and lots of ambiguous & ill-defined cases), since they can be dynamically constructed client or server, you can do anything you want.

          Comment


            #6
            One more note - you initially mentioned this for ListGrids. If that's really the only component in which you need dynamic titling, you can just use listGridField.title to override DataSourceField.title.

            Comment


              #7
              Originally posted by Isomorphic View Post
              One more note - you initially mentioned this for ListGrids. If that's really the only component in which you need dynamic titling, you can just use listGridField.title to override DataSourceField.title.
              I know that I can use listGridField.title but this is just for a particular component while our DataSource is used by several ListGrids. Hence after the user edits a column title name it should actually be reflected on all ListGrids that are using that DataSource... Plus the change is not reflected within the interface at runtime.

              Just to make it more clear: We can adjust the DataSource when it is created, hence using a DataSourceLoader or a DynamicDSGenerator I think it is actually too much... What we need is for the user change to be reflected smoothly without recreating the interface. Otherwise the change will anyhow be reflected on the next login within the application when the entire interface is recreated based on the newly generated DataSource.

              Comment


                #8
                DataSources cannot be changed after creation for the reasons explained above. But you can just use ListGrid.setFieldTitle() to change field titles dynamically, so all you need to do is keep track of the list of grids using the modifiable DataSource.

                Comment


                  #9
                  I understand. Then in this case we shall go ahead with the ListGrid.setFieldTitle() for the runtime update plus the use of DataSourceLoader for the start-up of the application. One thing to be mentioned is that a ListGrid.getHeader().redraw() must be called after changing the title because otherwise the change is not reflected within the interface. I think this should be done by default...

                  Thank you Blama and Isomorphic !

                  Comment


                    #10
                    Requiring a redraw would be true of listGridField.setTitle(), since title is not settable after init there, but not true of ListGrid.setFieldTitle(), which is correct usage.

                    Comment


                      #11
                      Originally posted by Isomorphic View Post
                      Requiring a redraw would be true of listGridField.setTitle(), since title is not settable after init there, but not true of ListGrid.setFieldTitle(), which is correct usage.
                      Got it! Indeed you are right. Thanks!

                      Comment

                      Working...
                      X