datatable toCSV

edited April 13 in Technical questions

Hi,
I wonder if it's possible to pass a dynamic list (array) to the webix.toCSV function:

In the examples this way is mentioned:

webix.toCSV($$("mydatatable"), 
        {
            filename: "export",
            columns:
            {
                "col1": true,
                "col2": true,
                "col3": true
...

What i need to do is:
Build an array (col1:true, col2, true, ...)
and pass this as the columns-attribute:

webix.toCSV($$("mydatatable"), 
        {
            filename: "export",
            columns: myArray

I can't get it to work.
Any ideas would be helpful.

Comments

  • edited April 12

    You don't need an array.
    Build an object is simple as:

    var myObject={}
    myObject.col1=true
    myObject.col2=true
    ...

    Make some FOR loop or other if you have all columns named col.

    https://snippet.webix.com/j57flf6r

  • Hey Jacekk015,
    this works perfect, esp. the code-snippet.
    You made my day!
    Thx so much for your support.

    Regards
    Wolfgang

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!