posToRef

converts a position of a cell into a cell reference

string posToRef(number row1,number column1,number row2,number column2,string sheet);
row1
numberthe number index of the first row column1
numberthe number index of the first column row2
numberthe number index of the second row column2numberthe number index of the second column sheetstringthe name of the sheet
stringa cell reference

Example

$$('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

Details

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]);
See also
  • API
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
    If you have not checked yet, be sure to visit site of our main product Webix javascript component library and page of spreadsheet javascript library product.