Spreadsheet

Hi,

How to add new sheet in following spreadsheet snippet?

https://webix.com/snippet/79b2df6c

Hello!
At this moment with bottombar:true need to add some data(like in the example below). Only after this sheets will be added as it should. We will fix this bug in the next update.
You can add a new sheet by using the <a href = "https://docs.webix.com/api__ui.spreadsheet_addsheet.html">addSheet</a> method. Should pass the sheet’s content as a parameter:

$$("id").addSheet(content);

Example: https://webix.com/snippet/80df6688

Hi,

How to freeze the columns and rows of spreadsheet.

I am trying to use $$(“ss”).freezeColumns(3);, $$(“ss”).freezeRows(3); but it is not working in my case.

https://webix.com/snippet/0bff27c9

Hi Webix team

Please provide solution for this.

Hello!
You can use <a href = "https://docs.webix.com/datatable__frozen_columns.html">Split Mode</a>

dtable = new webix.ui({
    view:"spreadsheet",
    ...
    leftSplit:2, // 2 columns will be frozen on the left side
});

Hi Nastja,

https://webix.com/snippet/834aa72d

I tried to use leftSplit:2 but it does not show any effect.

Hi Nastja,

https://webix.com/snippet/834aa72d

In this spreadsheet, If I select a cell from 3rd row and C’th column in order to paste the data still it paste the data from the first row and first column.
leftSplit:2 is not working in spreadsheet. How to show default text value to particular cell in spreadsheet.

Hello,

Please, check the alternative solution for copy-paste operations in Spreadsheet: https://webix.com/snippet/4d040cad. Here data is pasted with respect to start rows and columns.

As to the frozen rows and columns, let me clarify some moments:

  • leftSplit and topSplit are the properties of the inner Datatable, not the Spreadsheet itself. Inner datatable can be accessed as $$("spreadhseet").$$("cells").

  • freezeColumns and freezeRows methods set and remove the Datatable’s leftSplit and topSplit respectively, and work in both directions. If have already frozen some row, the next freezeRow() call with the same row id will unfreeze it.

So, you need to check for already frozen rows and columns beforehand, and also apply this method within the onAfterSheetShow handler to ensure that the Datatable is visible at the moment:

"onAfterSheetShow" :function(){
      var columnId = 3, rowId = 3;
      var grid = this.$$("cells");
      
      if(grid.config.topSplit !== rowId)
           $$("ss").freezeRows(rowId);
      if(grid.config.leftSplit-1 !== columnId)
            $$("ss").freezeColumns(columnId);        
}

Please, check the related snippet: https://webix.com/snippet/2e8facbd

Hi Webix Team,

https://snippet.webix.com/fcdzrjjb

In this snippet when I paste the data in first 5 columns of spreadsheet, and try to paste the same data in remaining columns of the same spreadsheet, then the data filled in the first 5 columns get removed.

Can you please help me into this?

Thanks

Hi Webix Team,

Please provide solution for this.

Hello,

While resetting the Spreadsheet for the new row and column count, you can memorize the initial data and restore it afterwards to prevent data loss:

//store initial data
var data = $$("ss").serialize();

$$("ss").reset();

//restore initial data
$$("ss").parse(data);

Here’s the snippet: https://snippet.webix.com/lz351u47

Just to be clear, the problem was caused by $$(“ss”).reset(); line in the snippet

The spreadsheet itself will not lose data on paste operations, but calling reset will erase all data.