Comments (4)
Hi @AHJackson87, happy to help. :) One quick question...are you applying this to a "DueDate" field, which is an actual date field? If so, I noticed you are doing a comparison for your '@currentField', which would be a date, to a number, not a date.
If my assumption is right, that your looking to apply this to an actual date field, would this definition work for you? :)
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"debugMode": true,
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": "=if(@currentField <= @now, 'sp-field-severity--warning', '')",
"iconName": "=if(@currentField <= @now, 'error', '')"
}
}
This puts the icon before the date, you might want it after the date based on your post. Let me know if that's the case and I can try to create one for you that does that. :)
from list-formatting.
Thanks,
Yes you are correct the due date field is a date filed.
Have tried the the code you suggested to with no luck.
Is it possible to highlight the whole row rather than just adding an icon in that column?
from list-formatting.
Thanks for the quick reply @AHJackson87.. :)
When you say no luck, is it the color formatting or the icon not working? Or possibly nothing appears to have changed.
To help ensure we are using it the same way, here is how I see it in my list:
This is being used as a column formatting definition in the "DueDate" column. Were you applying it the same way? :)
To help answer your second question, you can apply a color to the row, but that is applied using the View Formatting strategy. There is a great demo of that available here:
https://github.com/SharePoint/sp-dev-list-formatting/tree/master/view-samples/text-conditional-format
from list-formatting.
Closing due to lack of activity. Feel free to reopen as needed, thanks!
from list-formatting.
Related Issues (20)
- Project Gantt Chart - Tasks wider than the screen HOT 2
- FAQ Accordion overwrites sorting/ random order HOT 3
- Project Gantt Chart - Groups and Conditional Formatting HOT 2
- Many Design Bugs after Update in SharePoint HOT 3
- Is my Discussion Board displaying right? HOT 4
- Disable Click Action - Still Opens Item HOT 2
- Bug in "multi-person-reaction" HOT 10
- I have a question about FAQ Accordion HOT 1
- Document Library Approval Status HOT 1
- I have a question about the Discussion Board sample. HOT 3
- date-page-a-day-calendar displays day before in central time zone HOT 2
- Cannot embed video from SharePoint HOT 1
- Displaying a new column which is a hyperlink in list formatting HOT 12
- document-library-thumbnails not all documents are previewing HOT 8
- Unable to update column containing deleted user with setValue HOT 1
- Sample - yesno-icon-color not working as intended HOT 4
- I have a question about honeycomb-link when used with an embedded webpart HOT 2
- I have a question about formatting a column that contains a JSON string HOT 2
- I have a question about JSON code in lists HOT 2
- Generic Gantt chart - Date field cannot be edited HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from list-formatting.