Code Monkey home page Code Monkey logo

Comments (8)

ldemaris avatar ldemaris commented on September 20, 2024 2

Thanks for the feedback. This is a totally reasonable feedback, and we are working on a "Row Formatter" feature to accomplish this. I don't have an ETA for this feature right now, but this is something we're actively working on. Highlighting an entire row with a class or set of styles depending on the value of one or more fields in the view is one of the main scenarios we're working towards with this feature.

from list-formatting.

thechriskent avatar thechriskent commented on September 20, 2024 1

Column Formatting is intended for single column formats only, so outside of johnnyshield's answer, there isn't a way to accomplish this with column formatting. johnnyshield's answer would work in very specific circumstances but has a few drawbacks:

  • Your view could only contain field types that support column formatting
  • You aren't able to recreate the OOTB view for several field types (hyperlink, person, etc.) using column formatting so you would lose some functionality
  • Maintaining that solution would be tedious and error-prone

This isn't a criticism of johnnyshield since there isn't a better answer when it comes to column formatting across entire rows.

This can technically be done, however, with a Field Customizer (SharePoint Framework Extension) but requires you to manipulate the OOTB listview which isn't generally a great idea since there is no guarantee that markup/styles/etc. will not change and you may cause conflicts with other list features. Not only that, but this requires you to develop and deploy a package which is a large part of what column formatting helps us avoid.

This sounds like a good addition for User Voice. If you post it there, let me know and I'll upvote it.

from list-formatting.

sympmarc avatar sympmarc commented on September 20, 2024 1

They showed the row formatter at SPC, and it’s coming later this year. Expect it to be similar to the column formatter, with a JSON schema. I’m hoping there will be a built in UI by then to make the basic stuff easier.

from list-formatting.

ChrispyBites avatar ChrispyBites commented on September 20, 2024 1

I don't really get how they don't already have some kind of basic in-web UI
thing for the JSON column formatting stuff

@thechriskent has already put an SPFX web part together that does what I think you're talking about. You can find the project here and the SPPKG file here.

from list-formatting.

johnnyshield avatar johnnyshield commented on September 20, 2024

This is possible, but you'll need to apply similar formatting to each column, referring to the column name in square brackets. e.g. [$ColourThisRow].

You will make the rollout & maintenance easier if [$ColourThisRow] is a yes/no calculated column, so you can copy and paste relatively simple JSON code across all the columns.

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#fieldname

from list-formatting.

torresmatt avatar torresmatt commented on September 20, 2024

Anything new on this front? Got a user asking for this exact behavior in SharePoint.

from list-formatting.

torresmatt avatar torresmatt commented on September 20, 2024

from list-formatting.

thechriskent avatar thechriskent commented on September 20, 2024

I'm going to close this issue since View Formatting will be released soon and solves this issue. View Formatting allows you to specify a formatter (very similar to the Column Formatter syntax) directly to individual list views. In your formatter you can specify a rowFormatter property that gives you total control over how rows are rendered.

from list-formatting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.