docs/guide/FAQ.md
The content of this chapter collects the common problems that everyone has feedback. If the official documents and this list can’t answer your questions, I recommend you to Official Forum
<span style="font-size:20px;">A</span>: Use one-dimensional array format celldata, after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.
If you need to take out data as initial data, you need to execute transToCellData(data) to convert it to celldata data.
Among them, the celldata in { r, c, v } format is converted to a two-dimensional array using transToData(celldata)
Summarized as follows:
// data => celldata two-dimensional array data into {r, c, v} format one-dimensional array
luckysheet.transToCellData(data)
// celldata => data to generate the two-dimensional array required for the table
luckysheet.transToData(celldata)
<span style="font-size:20px;">A</span>: Refer to Cell Format List, with examples of available cell formats
<span style="font-size:20px;">A</span>: Check
<span style="font-size:20px;">A</span>: Refer to Table data format ,just set the calcChain corresponding to the cell data.
<span style="font-size:20px;">A</span>: loadUrl. Configure loadUrl, Luckysheet will request the entire table data through ajax, and updateUrl will be used as the interface address for collaborative editing in real-time saving. Note: Initial data needs to be configured with loadUrl parameter, while for collaborative editing, the four parameters of loadUrl, updateUrl and allowUpdate can be configured to take effect.
index and order for each sheet page?<span style="font-size:20px;">A</span>: Each sheet page has a unique id, which is index, which can be incremented by numbers or a random string. And order is the sorting situation of all sheets, starting from 0, can only be numbers 0,1,2....
<span style="font-size:20px;">A</span>: Need to start the local server
<span style="font-size:20px;">A</span>: The excel import and export library developed with Luckysheet-Luckyexcel has realized the excel import function, and the export function is under development.You can refer to these 2 blog posts for excel export at this stage:
<span style="font-size:20px;">A</span>: Refer to the following case:
<span style="font-size:20px;">A</span>: There are two options:
luckysheet.getAllSheets() to get all sheet data that stroed in the back-end.cellRenderAfter in real-time?<span style="font-size:20px;">A</span>: We have collected the secondary development requirements for cell events, and planned the cell-related hook functions, refer to cell hook function (the TODO displayed is not yet open)
<span style="font-size:20px;">A</span>: reference: options.showtoolbarconfig(TODO means waiting to developed)
<span style="font-size:20px;">A</span>: yes. At the beginning, Luckysheet uses jQuery。The packaging tool will package the jQuery to this file ./plugins/js/plugin.js
If your project (such as react / Vue) also references jQuery globally and causes conflicts, you can try to remove a jQuery.
if you want to remove jQuery in Luckysheet, you can find jQuery in source code folder gulpfile.js: src/plugins/js/jquery.min.js,then delete information related to jQuery.
<span style="font-size:20px;">A</span>: reference cell object format,then read this annotationsrc/controllers/postil.js。the annotation is a configuration in a cell object.
<span style="font-size:20px;">A</span>: The luckysheet use iconfont icon in this project, if any icon cannot be loaded ,plz check your iconfont.css. we are so sorry that we did not describe it clearly in the old version documents.
Now the documents have been updated.official documents
<span style="font-size:20px;">A</span>: Terminal does not show end, but if the dist folder has this file luckyexcel.js, it is normal.
Lucky excel is an excel import and export library. The project uses gulp as a packaging tool. There is a problem with the old version of the packaging tool, but it is fixed now. if this problem still troubles you, plz check the following steps:
npm inpm run buildmore information: Luckyexcel
<span style="font-size:20px;">A</span>: Sheet protection includes disable editing of cells that you need to make some configurations on each sheets. config.authority, the latest configurationssheet protection。
In order to make it easier for you to understand the function of sheet protection, the following video shows how to make the whole sheet uneditable, but allow a column of cells to be edited:
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=g3162sacwn6" allowFullScreen="true"></iframe>In you local browser, you can open the control pannel, use luckysheet.getLuckysheetfile()[0].config.authority to get the configuration parameters.
<span style="font-size:20px;">A</span>: there is the configuration of data validation,data validation。Also there is the API that you can use data validation in any time. setDataVerification.
<span style="font-size:20px;">A</span>: Luckysheet supports CDN. reference: The case of using luckysheet by CDN
<span style="font-size:20px;">A</span>: First of all, you need to move the picture and adjust the cell size, and then there are the following situations:
if you want to get the position of the picture, you can overlap the picture with the border of the cell.(in the source code, it needs to overlap more than 2px.)The following demo video shows how to limit the image to the adaptive width and height of the cell.
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=y3163ya0q6c" allowFullScreen="true"></iframe><span style="font-size:20px;">A</span>: There are two ways to get it
luckysheet.getLuckysheetfile() to get all configuration data, so you can get the defaultRowHeight and defaultColWidth in the sheet configuration data。<span style="font-size:20px;">A</span>: Configuration is open
<span style="font-size:20px;">A</span>: Configuration is open
config.merge?<span style="font-size:20px;">A</span>: Three methods
<span style="font-size:20px;">A</span>: The first step is to check whether you have used CDN to import,
The CDN link used in the Luckysheet tutorial is the service provided by jsdelivr, and the code is from npmjs.com automatically sync the past, not from Github. Because our newly submitted code still needs to be tested for a period of time, it will not be released to npm immediately, causing the npm code to lag behind Github.
If you need to try the latest code, we strongly recommend that you pull the code from the Luckysheet Github main repository. After our version is stable, we will consider releasing the npm package in real time.
The second step, if it is to import the packaged code of the github repository, test to determine whether there is a bug, you can find the problem and try to fix it, and then submit a PR, if can't fix it, please submit issues.
npm run dev reported an error: ʻError: Cannot find module'rollup'`?<span style="font-size:20px;">A</span>: It may be a problem with the npm package installation, try the following steps:
npm cache clean --forcenpm i rimraf -grimraf node_modulesnpm inpm run devTip: Most other npm installation problems can also be solved by trying above steps.
<span style="font-size:20px;">A</span>: The luckysheet-vue case is to provide an application integration solution.
If directly developed locally:
http://localhost:3001In this case, after Luckysheet is modified in real time, the changes can be seen in the Vue project
Store.createChart when creating chart?<span style="font-size:20px;">A</span>: You need to introduce a chart plugin to use it. You should configure the chart plugin to use when the workbook is initialized. Refer to
<span style="font-size:20px;">A</span>: The custom attributes directly assigned to the cell object will be filtered. To make the custom attributes take effect, you need to edit the code to remove the filter attributes.
'='? For example, =currentDate('YYYY-MM-DD'), it will remove the function by default, how to prohibit the function?<span style="font-size:20px;">A</span>: Just add a single quotation mark in front of it, and it will be forcibly recognized as a string, which is consistent with excel. For example: '=currentDate('YYYY-MM-DD')
<span style="font-size:20px;">A</span>: The API method luckysheet.create() does not have a callback, but Luckysheet provides a hook function to execute the callback method at a specified location, such as:
<span style="font-size:20px;">A</span>: When the cell is selected, it is highlighted by default, just remove the highlight, use API: setRangeShow
luckysheet.setRangeShow("A2",{show:false})
<span style="font-size:20px;">A</span>: In the source code src/controllers/hander.js, search for event.which == "3" to find the code executed by the right-click event.
<span style="font-size:20px;">A</span>: No configuration is currently provided, you can refer to the implementation of the print button in the toolbar to modify the source code:
luckysheet-icon-print globally to find the implementation of the print button, in src/controllers/constant.js add a similar template string, you need to customize a unique id<span style="font-size:20px;">A</span>: Two source codes need to be modified:
functionImplementation object in the src/function/functionImplementation.js file, format refer to formulas such as SUM/AVERAGEfunctionlist array in. Among them, t is the category of the function, m is the number of parameters, the minimum number of parameters and the maximum number of parameters.<span style="font-size:20px;">A</span>: Yes. Our loadSheetUrl provides this function, which can be turned on by initializing options.enablePage = true.
Searching for enablePage in the source code, you can see that there is a method.addDataAjax method, which contains an ajax request to dynamically load data, which will be appended to the worksheet.
This function is now hidden in the document, because when we made this interface, the interface parameters were matched according to our actual business, which may not be universal. We are going to abstract and release it for everyone to use. If you want to use it yourself you can change it based on this.
It is recommended that you consider writing your own interface to load the data, and then use setRangeValue to append the data at the specified location, which has a higher degree of customization.