I am trying to build a table component with a foundset and variable amount of columns available in developer properties, with the servoy bootstrap table component as an example.
In developer, the foundset property is "article", and I have 2 columns : "article_code" and "remarks"
In browser, foundset.viewPort.rows is giving something like
- Code: Select all
[{"_svyRowId": "36.860a62bd-2413-47a9-8cba-000021d19442;_0"}, {...}, {...}, ...]
With 860a62bd-2413-47a9-8cba-000021d19442 being my actual PK of an article record in my database.
So far so good but actually I was expecting my column data in the same object ?
- Code: Select all
[{"_svyRowId": "36.860a62bd-2413-47a9-8cba-000021d19442;_0", "article_code": "ARTICLE", "remarks": "REMARKS"}, {...}, {...}, ...]
I found out that I can get this column data through columns[0].dataprovider in browser.
But then I have to build my JSON manually, it would be nice to just provide the foundset.viewPort.rows to my component?
Am I doing something wrong?
Spec file :
- Code: Select all
"model":
{
"columns": { "type":"column[]", "droppable": true },
"text" : {"type":"tagstring" , "initialValue":"Button", "tags": { "directEdit" : "true" }},
"foundset": { "type": "foundset", "pushToServer": "allow"}
},
"types":
{
"column":
{
"dataprovider": { "type": "dataprovider", "forFoundset": "foundset" },
"format" : {"for":["valuelist","dataprovider"] , "type" :"format"},
"headerStyleClass" : { "type" :"styleclass", "tags": { "scope" :"design" }},
"headerText": {"type" :"string", "initialValue" : "header", "tags": { "showInOutlineView" :true }},
"styleClass" : { "type" :"styleclass", "tags": { "scope" :"design" }},
"valuelist" : { "type" : "valuelist", "tags": { "scope" :"design" }, "for": "dataprovider"}
}
},
"handlers":
{
},
"api":
{
Many thanks
Robrecht