Comments (9)
I'v got a Tabulator module on my (long) TODO list ;-)
I'm also aware of some performance problems with both data container and redux module, which both work with the same pattern - by removing and recreating components inside a container. I'm trying to apply some optimizations. Maybe you could share a sample project in which you encounter these problems.
from kvision.
You can't use standard FormPanel this way, because it always renders as a "form" with "div"s for its items. But it's fairly easy to create new FormPanel, which will render as a "tr" with "td"s. Just inherit and override two methods:
class RowFormPanel : FormPanel<SomeClass>(serializer = SomeClass.serializer()) {
override fun render(): VNode {
return render("tr", childrenVNodes())
}
override fun childrenVNodes(): Array<VNode> {
return super.childrenVNodes().map {
h("td", arrayOf(it))
}.toTypedArray()
}
}
I have tested this RowFormPanel class with this code:
val tableTemplate = Table(
listOf("Column 1", "Column 2"),
responsive = true
)
dataContainer(rowList, { element, idx, list ->
val internalFormPanel = RowFormPanel()
val text = Text()
text.setEventListener<Text> {
change = {
list[idx] = internalFormPanel.getData()
}
}
internalFormPanel.add(
SomeClass::one,
text
)
val text2 = Text()
text2.setEventListener<Text> {
change = {
list[idx] = internalFormPanel.getData()
}
}
internalFormPanel.add(
SomeClass::two,
text2
)
internalFormPanel.add(Button("Delete").onClick {
list.removeAt(idx)
})
internalFormPanel.setData(element)
internalFormPanel
}, tableTemplate)
button("Add row").onClick {
rowList.add(SomeClass())
}
button("Print data").onClick {
println(rowList.toList())
}
It's rather ugly (definitely needs some styling) but fully working :-)
from kvision.
kvision-tabulator module is almost ready. It will be available in the next realese.
from kvision.
Great thank you!
from kvision.
I am just getting around to testing this fully and have realized it becomes a little slow when you try to try to load any more than 20 entries at once, is it possible to request an integration with kotlin-react-dom or some kind of reactive editable table for next release?
from kvision.
tabulator looks awesome, that would solve all my problems!
Great I'll see what I can do about the sample project
from kvision.
Thats great news, things really move quickly around here 👍
from kvision.
I've updated the guide with some information and sample code on tabulator module usage. There is also rewritten addressbook-tabulator example and small sample in the showcase app.
from kvision.
Thank you Robert
from kvision.
Related Issues (20)
- Request - support for crossorigin attribute in Image (and others) HOT 1
- Ability to intercept image load errors HOT 2
- Component lifecycle HOT 6
- StackPanel seems to not indexing components properly HOT 4
- Wrong module in kvision.gitbook.io. HOT 1
- trying to generate .pot files HOT 12
- overrides of `SimplePanel.AddAll` call refresh outside of a `singleRender` wrapper. HOT 1
- Allow KVService to have arguments with GET HOT 6
- Allow modifying response headers for Spring Boot and Micronaut apps HOT 1
- remove id parameter on get requests HOT 1
- Can't get data from Tabulator.RowComponent HOT 2
- Expandable/collapsible fieldset or panel HOT 2
- How to attch files using the Richtext Component HOT 7
- duplicated different word in kvision docs HOT 1
- did you consider to integrate kvision with ktor client? HOT 5
- can't make tabulator selectable with kvision v7.4.4 HOT 2
- My tabulator not selecting data HOT 5
- How to add more than one bottomCalc rows? HOT 2
- kvision gradle plugin not works well with Spring-Web-Flux HOT 4
- DropDown - call method instead of loading a route HOT 2
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 kvision.