colour formatting fields in vlookup table

Forums Dynamic Forms for SharePoint colour formatting fields in vlookup table

Viewing 2 reply threads
  • Author
    Posts
    • #34858
      Phil Grant
      Participant

      Hi,
      Is it possible to change the background colour of a field in a vLookup list on a parent form based on it content i.e. red background if the value is “No” and Green if “Yes”?
      I know you can give some “Special configurations” code to the field in the vLookup config but I don’t know if you can include If/Then statements?

      Cheers,
      Phil

    • #34860
      Alexander Bautz
      Keymaster

      You can add this to your custom js:

      function vLookupIsLoadedCallback(fin) {
          if (fin === "vLookupTasks") {
              jQuery("#dffs_vLookupTasks").find(".vLookupTasks_Status").each(function(i, td){
                  if(jQuery(td).text() === "New"){
                      jQuery(td).css({"background-color": "red", "color": "white"});
                  }
              });
          }
      }

      Replace vLookupTasks_Status with the internal name of your vLookup field in combination with the internal name of the field from the child list (right click and inspect the cell in your vLookup table to see the class attribute for the correct name) and then replace the two remaining vLookupTasks with the internal name of your vLookup field.

      Alexander

    • #34873
      Phil Grant
      Participant

      Works a treat, thanks for the quick reply.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.