Comments (1)
Things are a bit difficult. BaseComponent contains many model fields and builder methods that provide basic functionality that can apply to any html element, but we cannot make everything a BaseComponent because that'd boost memory footprint quite a lot in case of a datatable for example. Now that we need a "part" of basecomponent functionality for table rows and cells, we have to use composition instead of inheritance.
Model
- add a styleclasses list in DataTableCellModel and DataTableRowModel. It should be null by default. Create a HasStyleClasses interface and BaseComponentModel should also implement that (with the getter and setter).
Builder
- create a StyleClassesBuilder class that takes a HasStyleClasses as a constructor parameter and provides addStyleClass, bindStyleClassPresent, removeStyleClass, as seen in BaseComponent. Create an instance of this class in BaseComponent and make the above three methods delegates to this styleclassesbuilder instance.
- ... the way to use this builder for cells and rows is yet to be defined.
Renderer
- based on the styleClasses listener in BaseComponentRenderer, create an individual class called StyleClassesRenderer that takes the list binding as the first and the JQuery widget as the second constructor parameter.
- make it implement the ListenerRegistration interface, so that it can be disposed.
- use these classes in the renderRow method in DataTableRenderer
- make sure to properly dispose listeners
... to be defined.
from dsweb.
Related Issues (20)
- Some renderers don't properly detach their children
- DepShield encountered errors while building your project
- DepShield encountered errors while building your project
- Reacting to column changes in DataTable HOT 1
- Deferred reaction to selectedIndex changes
- Support all DOM events in BaseComponent
- Checkbox value does not change in special case
- Set InputText selection
- Typeahead renderer doesn't seem to react when the bound model is set to null
- Button rendering issue in table with visible=false HOT 1
- Unable to reset select components
- support AbstractTextColumn
- review: deferred updating of html dom in renderers
- TabSheet - tabsheet label css change HOT 1
- Attribute manipulation HOT 1
- Length property of textfield and textarea HOT 2
- TextProperty update when typing
- Support remote data source in inputtags HOT 3
- Finally dispose disposable renderers
- Support components in table headers
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 dsweb.