jspreadsheet / ce

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
https://bossanova.uk/jspreadsheet/v4
MIT License
6.7k stars 820 forks source link

Search within a column #205

Closed kickbox closed 6 years ago

kickbox commented 6 years ago

Is there a function to search within a column and find the CellName(B1,etc) that matches the input string ?

Example.

$('#jexcel').jexcel('search', ColumnName, "value") 
// returns cell ID 'B1' which contains "value"
kickbox commented 6 years ago

I think I have found a way to answer this myself, by usingArray.FindIndexfunction.

The code looks something like this

var columnData = $('#jexcel').jexcel('getColumnData', columnId);
rowId = columnData.findIndex(ob => ob == "value")