converts a position of a cell into a cell reference
row1 | number | the number index of the first row |
row2 | number | the number index of the second row |
column1 | number | the number index of the first column |
column2 | number | the number index of the second column |
sheet | string | the name of the sheet |
string | a cell reference |
$$('ssheet').posToRef(1, 1); // A1
$$('ssheet').posToRef(1, 1, 2, 2); // A1:B2
$$('ssheet').posToRef(1, 1, null, null, "Sheet1"); // Sheet1!A1
//or
$$('ssheet').posToRef(1, 1, 1, 1, "Sheet1"); // Sheet1!A1
$$('ssheet').posToRef(1, 1, 2, 2, "Sheet1"); // Sheet1!A1:B2
In case you need to convert the column letter into the index and vice versa, you can do it in the following way:
var ssheet = webix.ui({
view:"spreadsheet",
toolbar:"full",
data:spreadsheet_data
});
const col = 28;
// the number to the letter
const colLetter = ssheet.posToRef(1, col).split("1")[0];
webix.message(colLetter);
// the letter to the number
webix.message(ssheet.refToPos(colLetter+1)[1]);