How to display data in column based on dropdown

Tags: #<Tag:0x00007fa98e2a67e8>

HI, How to display data in column based on select ?I’ve seen the documentation, but it’s very confusing, maybe some can help

var setting={
data: []
,
minSpareRows: 20,
columns: [
{type: ‘dropdown’, numericFormat: {pattern: ‘000’}, validator: ‘tps’, source: myTps}
{type: ‘text’, allowInvalid: true, editor:false}
],
rowHeaders: true,
colHeaders: [“id”,“NKK”],
filters: true,
dropdownMenu: false,
width: resizeGrid(),
height: 500,
maxRows: 300,
}

Hey @rizkyfathurahman172

by select do you mean the select cell type or the selection (selected cell/cells)?

Select, for example I have 2 columns, ID and name. Type of field ID (dropdown), type of name (text),
When the ID (dropdown) is selected, the column name displays result data from select ID,

So let’s say that here https://jsfiddle.net/fvxeyL0h/1/

If you select 2 you wan to show 1,2,3 instead of marry?

https://jsfiddle.net/xy8c6kt2/1/

When column A is selected (dropdown) then column B next to display results from column A (dropdown), column A (Dropdown) Select 1 = Column B (text) Displays 1!

Hi @rizkyfathurahman172

You could achieve this by listening to beforeChange hook.
Here is a demo with this approach - https://jsfiddle.net/handsoncode/e5tn7ogL/1/?utm_source=website&utm_medium=embed&utm_campaign=e5tn7ogL

Please read about cell dependencies on our blog post - https://handsontable.com/blog/articles/2016/4/expand-your-app-with-cell-dependencies

Let me know if you need anything else.

I guess that we can close this ticket as there are no additional questions.