Column type

Tags: #<Tag:0x00007f8b19ca0e30>

Hi Guys,
I am passing dynamic data to handsontable by passing two objects. Header and rows:

//get dynamic header
var headers = Object.keys(Dataobj[0]);

//get datarows
function getRows() {
    var columns = [];
    var properties = Object.keys(Dataobj[0]);
    for (var i = 0; i < properties.length; i++) {
        columns.push({
            data: properties[i],
            type: 'text'
        });
    }
    return columns;
}

//bind header and data to handsonTable
columns: getRows(),
colHeaders: headers,

Now my question is how do I pass the type. You can see that I head coded to text right now.

I’m wondering if handsontable can recognize my columns type.

Please, help.

Hi @moti2424

type can be set for the whole instance, for column/rows and even single cells separately. If you can share the type structure I can help you to pick the best scenario.

ps. text type is set by default so you do not need to and the line.

Hi Aleksandra,

Thank you for your reply.
Please, follow my types:
text(default), number, date, dropdown.

I am still not sure how you can help with the setup as I am getting my table dynamically and I need to
interpret each column what it is.

Question:
Do you guy have any online support? like one on one session. We like your product and we really want to integrate it to our application, but still we have couple of crucial questions before we go forward.

Thank you.

I would like to mention that I also need to return format like:
phone, date,

Thanks.

Hi @moti2424

we offer a code review sessions as a part of our commercial offer. But if you would like to order one please write directly to support@handsontable.com

When it comes to column types you can share them via columns or cells methods. For the cells, it could look like this http://jsfiddle.net/an8eybh9/
I do not know if that is what you were looking for so please let me know if I’m missing something