Giter Site home page Giter Site logo

Comments (7)

sirion avatar sirion commented on May 29, 2024 1

"class" is not a property of the control, thus it cannot be used in databinding.

Usually you do not want styling information in your model as it defeats the purpose of the MVC pattern.

One workaround for your exact behavior would be to extend the used control and add a property that you can render any way you want in your own renderer,
What problem do you want to solve here? There are usually better ways.

Best regards,
Jens

from openui5.

sirion avatar sirion commented on May 29, 2024 1

Status is semantic information, so this definitely belongs in the model.

Here is an example of one way you could solve this: http://jsbin.com/sefiw/5/edit?html,output

from openui5.

martinr92 avatar martinr92 commented on May 29, 2024

Thanks for the fast response.
In my case, the model contains only a field named "status". For each status we wanna set custom styles (font-size, font-color and background color of the cell).
So I thought, that the simplest way would be to create a css class with the name of the status and just bind them to the cell.
So what's your recommended way to implement this?

Best regards,
Martin

from openui5.

aborjinik avatar aborjinik commented on May 29, 2024

Using factory function could also be another approach for the list.
https://openui5.hana.ondemand.com/#docs/guide/91f057786f4d1014b6dd926db0e91070.html

from openui5.

martinr92 avatar martinr92 commented on May 29, 2024

@sirion Thanks for the example. This is exactly what I'm looking for.

from openui5.

sirion avatar sirion commented on May 29, 2024

Glad I could help. :)

from openui5.

rberral avatar rberral commented on May 29, 2024

Thank you for your help! This article helped me.

from openui5.

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.