Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. JarVis 3 - JSON Tabelle - Zellen modifizieren (gelöst)

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    JarVis 3 - JSON Tabelle - Zellen modifizieren (gelöst)

    This topic has been deleted. Only users with topic management privileges can see it.
    • Frank Kabisch
      Frank Kabisch last edited by Frank Kabisch

      Hallo zusammen.

      Vmtl mache ich jetzt ein altes Fass auf; leider habe ich im Forum (und auch im Web) nicht wirklich etwas gefunden.
      Ich nutze die JarVis3 - bin auch voll zufrieden damit, weil echt vielseitig nutz- und anpassbar.

      Leider will es mir nicht gelingen, eine JSON-Tabelle (besser deren Zellen) zu modifizieren. Also ja, aber nur teilweise.

      Im Screenshot seht Ihr, dass der "Gelbe Sack" auch sauber in gelb dargestellt wird.
      Wie müsste ich meinen Code anpassen, damit das auch die anderen Einträge passiert.
      Quelle der Daten: (Datenpunkt): ical.2.data.table

      [
        {
          "field": "date",
          "label": "Datum",
          "align": "left",
          "mask": "dd.mm.yyyy"
        },
        {
          "field": "event",
          "label": "Typ",
          "align": "left",
          "style": "(rowIndex, row, props) => (row.event == 'Gelbe/r Sack/Tonne' ? 'color: #ffff00' : 'color: #ffffff')"
        }
      ]
      

      Screenshot:
      2025-01-03_Vis_01.png

      Oder geht das so gar nicht?

      Vielen Dank.

      M 1 Reply Last reply Reply Quote 0
      • M
        MCU @Frank Kabisch last edited by

        @frank-kabisch Verstehe gerade nicht was du erreichen willst.

        Frank Kabisch 1 Reply Last reply Reply Quote 0
        • Frank Kabisch
          Frank Kabisch @MCU last edited by

          @mcu
          Ich möchte gerne, dass der Text in den Zellen in Abhängigkeit des Wertes eine bestimmte Farbe annimmt.
          Also. z.B. gelb für gelber Sack, blau für Papiertonne, usw.

          M 1 Reply Last reply Reply Quote 0
          • M
            MCU @Frank Kabisch last edited by

            @frank-kabisch Versuch es mal so?

            {
            ...
            "style": "(rowIndex, row, props) => (if(row.event == 'Gelbe/r Sack/Tonne'){'color: #ffff00'} else if(row.event == 'Papiertonne'){'color:0000ff'} else 'color: #ffffff')"
            }
            
            Frank Kabisch 1 Reply Last reply Reply Quote 0
            • Frank Kabisch
              Frank Kabisch @MCU last edited by

              @mcu said in JarVis 3 - JSON Tabelle - Zellen modifizieren:

              "style": "(rowIndex, row, props) => (if(row.event == 'Gelbe/r Sack/Tonne'){'color: #ffff00'} else if(row.event == 'Papiertonne'){'color:0000ff'} else 'color: #ffffff')"

              Unexpexted token "if" .... schreibt die Visualisierung2025-01-03_Vis_02.png

              M 1 Reply Last reply Reply Quote 0
              • M
                MCU @Frank Kabisch last edited by

                @frank-kabisch Und so?
                {
                ...
                "style": "(rowIndex, row, props) => (row.event == 'Gelbe/r Sack/Tonne' ? 'color: #ffff00' : row.event == 'Papiertonne' ? 'color:0000ff' : 'color: #ffffff')"
                }

                Frank Kabisch 1 Reply Last reply Reply Quote 0
                • Frank Kabisch
                  Frank Kabisch @MCU last edited by

                  @mcu
                  gleiches Ergebnis, wie im Eingangspost ... aber kein Fehler mehr.

                  Nur der gelbe Sack ist gelb ...

                  Ist so, als ob das alles irgendwie komplett ignoriert wird.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MCU @Frank Kabisch last edited by MCU

                    @frank-kabisch Ich muss es dann mal selber integrieren. Welche jarvis-Version?

                    Frank Kabisch 1 Reply Last reply Reply Quote 0
                    • Frank Kabisch
                      Frank Kabisch @MCU last edited by Frank Kabisch

                      @mcu

                      v3.1.8 incl. Pro-Account

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MCU @Frank Kabisch last edited by

                        @frank-kabisch v3.1.8, v3.2.8 gibt es nicht. ok

                        Frank Kabisch 1 Reply Last reply Reply Quote 0
                        • Frank Kabisch
                          Frank Kabisch @MCU last edited by

                          @mcu
                          ja sorry ... vertippt

                          M 1 Reply Last reply Reply Quote 0
                          • M
                            MCU @Frank Kabisch last edited by

                            @frank-kabisch Also man muss auf die Verschachtelung achten.

                            {
                            "style": "(rowIndex, row, props) => (row.event == 'Gelbe/r Sack/Tonne' ? 'color: #ffff00' :  (row.event == 'Biotonne' ? 'color: #00ff00' :  (row.event == 'Papiertonne' ? 'color: #0000ff' : 'color: #ffffff')))"
                            }
                            
                            Frank Kabisch 1 Reply Last reply Reply Quote 0
                            • Frank Kabisch
                              Frank Kabisch @MCU last edited by

                              @mcu said in JarVis 3 - JSON Tabelle - Zellen modifizieren:

                              "style": "(rowIndex, row, props) => (row.event == 'Gelbe/r Sack/Tonne' ? 'color: #ffff00' : (row.event == 'Biotonne' ? 'color: #00ff00' : (row.event == 'Papiertonne' ? 'color: #0000ff' : 'color: #ffffff')))" }

                              Geil.Passt.
                              Vielen Dank für Deinen Einsatz!

                              1 Reply Last reply Reply Quote 0
                              • I
                                intruder7 last edited by intruder7

                                @MCU
                                Weil es hier einpasst....
                                Wie kann man dann ein Vergleich aller Werte in einer Spalte machen und z.B. den größten Wert hervorheben?. Und kann man an den Wert aus dem JSON eine Einheit ranhängen?

                                Viele Grüße

                                Hintergrund: ich würde gerne den günstigsten Wert aus meiner Tabelle der Tankstellen und Preise hervorheben.

                                [
                                  {
                                    "field": "img",
                                    "format": "val => val = '<div style=\"width:20px; height:20px;\"><img style=\"width:100%;height:100%\" src='+val+'></div>'",
                                    "label": "ICON"
                                  },
                                  {
                                    "field": "name",
                                    "align": "left",
                                    "label": "Nmae"
                                  },
                                  {
                                    "field": "diesel",
                                    "align": "left",
                                    "label": "Diesel"
                                  },
                                  {
                                    "field": "E10",
                                    "align": "left",
                                    "label": "E10"
                                  },
                                  {
                                    "field": "E5",
                                    "align": "left",
                                    "label": "E5"
                                  },
                                  {
                                    "field": "status",
                                    "align": "left",
                                    "label": "Status"
                                  }
                                ]
                                
                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  MCU @intruder7 last edited by MCU

                                  @intruder7 Wäre besser wenn du einen eigenen Thread aufmachst. Danke.
                                  Zum Thema ranhängen der Einheit

                                  "format": "val => val = val+' €'",
                                  

                                  Scheint eine eigene Tabelle zu sein, bitte reinstellen, in den eigenen Thread.

                                  EDIT:
                                  Geht nicht, da man in der Zeile keinen Zugriff auf alle Elemente hat. -> Eigenes Programm schreiben und damit eine eigene JSON erstellen, wo man die gewünschten Elemente hervorhebt.

                                  d2edd880-e7de-409a-ad6a-5f7939bd939b-image.png

                                  f2ce3241-531b-4a09-b690-f815a621a329-image.png

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  464
                                  Online

                                  31.7k
                                  Users

                                  79.6k
                                  Topics

                                  1.3m
                                  Posts

                                  3
                                  15
                                  280
                                  Loading More Posts
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  Community
                                  Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                  The ioBroker Community 2014-2023
                                  logo