Create a conditional format data frame
Create a conditional format data frame.
labkey.domain.createConditionalFormat(queryFilter, bold=FALSE, italic=FALSE, strikeThrough=FALSE, textColor="", backgroundColor="")
queryFilter |
a string specifying what logical filter should be applied |
bold |
a boolean for if the text display should be formatted in bold |
italic |
a boolean for if the text display should be formatted in italic |
strikeThrough |
a boolean for if the text display should be formatted with a strikethrough |
textColor |
a string specifying the hex code of the text color for display |
backgroundColor |
a string specifying the hex code of the text background color for display |
This function can be used to construct a conditional format data frame intended for use within a domain design's
conditionalFormats component while creating or updating a domain. The queryFilter parameter can be used in conjunction
with labkey.domain.createConditionalFormatQueryFilter
for convenient construction of a query filter string. Multiple conditional
formats can be applied to one field, where each format specified constitutes a new row of the field's conditionalFormats
data frame.
If text formatting options are not specified, the default is to display the value as black text on a white background.
The data frame containing values describing a conditional format.
Rosaline Pyktel
library(Rlabkey) domain <- labkey.domain.get(baseUrl="http://labkey/", folderPath="home", schemaName="lists", queryName="test list") ## update the third field to use two conditional formats qf <- labkey.domain.FILTER_TYPES cf1 = labkey.domain.createConditionalFormat(labkey.domain.createConditionalFormatQueryFilter(qf$GT, 100), bold=TRUE, text_color="D33115", background_color="333333") cf2 = labkey.domain.createConditionalFormat(labkey.domain.createConditionalFormatQueryFilter( qf$LESS_THAN, 400), italic=TRUE, text_color="68BC00") domain$fields$conditionalFormats[[3]] = rbind(cf1,cf2) labkey.domain.save(baseUrl="http://labkey/", folderPath="home", schemaName="lists", queryName="test list", domainDesign=domain)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.