How to copy the table object to another object ?

Hi ,

I have a table with 3000 rows, I want to download the table data into a excel file.
However, the excel file is not getting downloaded and neither giving any success or error message even when I use the below code:

webix.toExcel(obj).then(function(){
 //success
}).fail(function(err){
  //log error message
});

So, I want to know use the toExcel function by passing the table object with 100 rows in it so that I can find out at what point it is failing due to some character in the table data or due to long row numbers etc and debug from there itself.

Please consider this snippet which is just having 3 rows :
https://snippet.webix.com/rx2eleyu

How can I copy the table object $$(‘tableid’) to another variable and manipulate that variable to reduce its row numbers.

I have tried with webix.copy as below, but it is not working:

var t =  $$('tableid');
var t2 = webix.copy(t);

my plan is I will hold the t2.data.pull in another variable, then reduce its row number and assign it back to t2.data.pull and finally pass it as :

webix.toExcel(t2);

In next iteration, I will again increase row number by 100 by modifying t2.data.pull and so on…

Thanks.

Hello,

Yep, I do confirm that the fail function is not called when something goes wrong in the export process - it just fails silently for now. But we will update our export code to make error tracking more reliable.

How you can test it now:

Please, note that webix.copy cannot be called against the initialized view object (it is too complex for being copied). So you can copy just table.data.pull or table.data.order to manipulate them in your functions.

But actually, you can make use of the filter option in the export config to limit the number of exported rows:

var i = 1;
function saveValues() {
  var $$t = $$('tableid');
  webix.toExcel($$t, {
    filter:function(obj){
      return obj.id0 <= i;
    }
  }).then(function(){
    i++; 
  });
}  

https://snippet.webix.com/7k1ao7ri