{"id":37688,"date":"2024-11-10T23:02:57","date_gmt":"2024-11-10T22:02:57","guid":{"rendered":"https:\/\/help.qualiware.it\/qw-help\/?p=37688"},"modified":"2024-11-10T23:02:57","modified_gmt":"2024-11-10T22:02:57","slug":"griglia-e-vistadati-cambio-colore-righe-in-base-al-valore-di-un-campo-vers-javascript-nuovo-layout","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/griglia-e-vistadati-cambio-colore-righe-in-base-al-valore-di-un-campo-vers-javascript-nuovo-layout\/","title":{"rendered":"Griglia e VistaDati: cambio del colore di una cella in base al valore (vers. javascript &#8211; nuovo layout)"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\/\/ Il seguente snippet deve essere inserito nell'evento DatiCaricatiClient per applicare uno stile differente ad una cella in base al valore contenuto nella stessa\r\n\/\/ N.B. usare se NuovoLayout=true\r\n\r\nlet grid = $('#&lt;DataView1&gt;') \r\n\r\nfor (i = 0; i &lt; grid.rowCount(); i++) { \r\n    if (grid.getCellValue(i+1, \"UNMIS\")=='pz') { \r\n        grid.getCell(i+1,\"UNMIS\").css('background-color','red') \r\n     } \r\n    else { \r\n        grid.getCell(i+1,\"UNMIS\").css('background-color','none')\r\n     } \r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ Il seguente snippet deve essere inserito nell&#8217;evento DatiCaricatiClient per applicare uno stile differente ad una cella in base al valore contenuto nella stessa \/\/ N.B. usare se NuovoLayout=true let grid = $(&#8216;#&lt;DataView1&gt;&#8217;) for (i = 0; i &lt; grid.rowCount(); i++) { if (grid.getCellValue(i+1, &#8220;UNMIS&#8221;)==&#8217;pz&#8217;) { grid.getCell(i+1,&#8221;UNMIS&#8221;).css(&#8216;background-color&#8217;,&#8217;red&#8217;) } else { grid.getCell(i+1,&#8221;UNMIS&#8221;).css(&#8216;background-color&#8217;,&#8217;none&#8217;) } }<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[88],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/37688"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=37688"}],"version-history":[{"count":1,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/37688\/revisions"}],"predecessor-version":[{"id":37690,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/37688\/revisions\/37690"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=37688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=37688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=37688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}