Tabulator formatter "lookup" with multiselect - tabulator

I have a Tabulator table and i need to edit a cell with a lookup but with also a
multiselect.
if I use no lookup and "formatter": "textarea" it works but show the key (1, 2, 3) like expected, if a use "lookup" it show the values in the dropview but no results in the cell.
lookup with no multiselect works like expected also.
{title:"Centri Produzione",
field:"id_centro_produzione",
widthGrow:3,
editor:"select",
editorParams:{multiselect: true,
values: {"1:"pluto", "2":"topolino", "3":"minnie"},
formatter: "lookup",
formatterParams: {"1:"pluto", "2":"topolino", "3":"minnie"}
},
thanks

Related

Tabulator.js - doesn't seem possible to hide column group initially

I have a tabulator table displaying a set of grouped columns.
I would like to have some of the groups hidden by default, so I add visible: false to the group definition
{ title: "A group", headerTooltip: "Data relevant to group", visible: false,
columns: [
{ title: "blah", field: "blah", },
],
},
But the column group is displayed when the table loads.
When I hide/unhide the column group from javascript I can see the visible flag toggle between true and false.
Any advice to make this work would be much appreciated.
(Currently I have to hide all of the columns in the group to make the group hidden).
Thanks
Mike

Tabulator 5.2 New editor List option/value

In the new tabulator v5.2, the editor "select" was changed to "list", I have this code that was working fine in v5.1 but stop working in the new version, I hope someone can help me figured out what do I need to change to make it work again with this new version of tabulator.
Ex: in my table there are two columns with select dropdown values, the second column is dependent on the first. So if I select "Sales" in the first column, in the same row on the second column it will only show a list of "services" that belongs to the "Sales" department and so on.
In the code linked below you can see that in the first column when I click in a row in the "Dept" column, a list of values shows up, and if I select the value "Sales" it change to option "1".
{title:"DEPT", field:"dept", width:90, hozAlign:"left", editor:"list", editorParams:{values: {1:"Sales",2:"Service",3:"Bodyshop",4:"Carwash"}}},
{title:"WORK Type", field:"service", editor:"list", editorParams:{values: serviceList}},
jsfiddle
You can use the built-in lookup formatter to do that:
columns:[
{title:"DEPT", field:"dept",
width:90, hozAlign:"left",
editor:"list",
editorParams:{
values: {1:"Sales",2:"Service",3:"Bodyshop",4:"Carwash"}
},
formatter:"lookup",
formatterParams:{
1:"Sales", 2:"Service", 3:"Bodyshop", 4:"Carwash"
}},
Passing the same object of editorParams into the formatterParams would do your job.
Working Demo: https://jsfiddle.net/Mahesh1312/rzbxvym7/5/
Hope it helps!

Tabulator: Have a value associated with cell

I am deciding to use this wonderful Tabulator js library but I want to have a different value associated with each cell value that is displayed.
Like
<td value="1">Bob</td>
I see the below options for setting a drop down
columns:[
{title:"Name", field:"name", editor:"select", editorPramas: names
]
where names = { 1: 'Bob', 2: 'Jack'}
however this results in bob and Jack being displayed in the drop down and when Bob is selected it displays 1 in the cell value. However I want Jack and Bob to be in dropdown and when Bob is selected data cell gets value of 1 because I have columns values mapped to IDs which need to be stored in database.
This can be done by custom editorParams
columns:[
{title:"Name", field:"name", editor:"select", editorPramas: myCustom
]
var myCustom = function(cell) {
cell.getElement().setAttribute("value",2);
...
}
whereby one can get the cell element which is changed and accordingly change any attribute of it.
I believe this feature should be considered and generic in the next release.
I proposed a hack for the input editor but this should be done in a generic way with the new parameter elementProps
https://github.com/olifolkerd/tabulator/issues/1869

How do I onSelect dropbox list value to display text label dynamically in Microsoft Excel using Powerapp?

Please help me look at the below advanced excel functions, I would like to onSelect the dropdown list value and display a text value on the label, named DisplayBuilding.
If(InspectorDropdown.Selected.Value = "Jonathan Soh", DisplayBuilding = Building.buildingID = 1)
Assuming DisplayBuilding is from a table, you would want to use "LookUp" function to find the record to display. Here is an example. When the selected value of Dropdown is "ccc", the "LookUp" function is evaulated to find a record which Titile equals to "bbb" and display its Title or any column of your choice.
If(Dropdown1.Selected.Value = "ccc", LookUp('aaaTable', Title = "bbb", Title))

How to update a specific row of a table in Excel using Microsoft Graph?

I try to update a specific row of a table in Excel using Microsoft Graph.
I didn't find any document in the table section.
For example, I want to update No. 6 row (index 5).
Is there any way like this? Thanks
PATCH:
https://graph.microsoft.com/beta/me/drive/items/12345/workbook/tables/Table1/rows/update
{
"index": 5,
"values": [
[1, 2, 3]
]
}
You can patch the table row as below. This example updates row 2 (index=1) of a table that contains 4 columns. Note that index value is 0-indexed and also header row is not part of the rows collection here.
PATCH https://graph.microsoft.com/v1.0/me/drive/root:/nameditemtest.xlsx:/workbook/worksheets/sheet1/tables/Table1/rows/$/ItemAt(index=1)
{
"values": [
[
"A",
"B",
"C",
"D"
]]
}
Result:
If you wish to patch the header row, you can patch the underlying range values property using path of PATCH ../tables/{id|name|}/rows/$/ItemAt(index={index}/headerRowRange -OR- update name property of the table column using path of PATCH ../tables/{id|name}/columns/{id}

Resources