0

sliding dchoice

Die Idee dahinter ist ein dynamisches Auswahlfeld, welches mit den Werten in den Jahren automatisch weiter gleitet und immer die letzten 3 (oder mehr) und das aktuelle Jahr anzeigt. Das sie in meine Tabelle "witziger Code mit gewissem Nutzen" Eingang gefunden hatte, teilen ich das mal hier - aber vielleicht ist es auch ein alter Hut;-). Mirko

let caption := range(year(today()) - 3, year(today()) + 1);
for i in range(cnt(caption)) do
    let object := {};
    setItem(object, "id", i + 1);
    setItem(object, "caption", item(caption, i));
    setItem(object, "color", "#ff9900");
    object
end

3 Antworten

null
    • Fred
    • vor 5 Tagen
    • Gemeldet - anzeigen

    My only worry is that when the year changes your old data will be incorrect. If you selected 2022 back in 2025, 2022 will no longer exist now that we are in 2026 and you lost that data.

      • mirko3
      • vor 5 Tagen
      • Gemeldet - anzeigen

       Hi, Fred. There you are right. In my case, I only read the value with number(text(dchoice)) to use it as a filter in the table. This filtered tableview then allows me to keep track of the current year and the previous year. Other data is not important to me in this view, not is it lost.

      • Fred
      • vor 5 Tagen
      • Gemeldet - anzeigen

       Good point. I don't use dynamic fields to store data, because of the resetting of recID issue. So as a UI element it makes complete sense.

Content aside

  • vor 5 TagenZuletzt aktiv
  • 3Antworten
  • 32Ansichten
  • 2 Folge bereits