SpreadJS allows users to automatically fill strings by using the drag fill option. You can simply drag the fill handle in an upward or downward direction in order to fill the cell data with strings across the entire column in the worksheet.
Users can also carry out other custom string filling operations like filling cells with strings that contain numbers only and filling cells with strings that contain number at the end, as shown in the image shared below.
The following example image depicts automatic filling of strings that contain numbers initially and strings that just copy data in the same order.
Refer to the following example code in order to automatically fill strings that contain numbers only, strings that contain number at the end, strings that contain numbers initially and strings that copy data in the same order.
JavaScript |
Copy Code
|
---|---|
$(document).ready(function () { // Drag Fill strings //N: number, S: string. sheet1.setValue(1, 4, 'String contains number in the end'); // Choose "Fill Series" for the single one sheet1.setValue(13, 0, 'String contains numbers initally'); sheet1.setValue(13, 4, 'String just to copy'); |