Columns

Columns

freecexfreecex Posts: 25Questions: 4Answers: 0

Hi,

I'would like to define columns prop by an array (coming from httppost)
I tried with

var Nomi = [];
for 1 to 10
Nomi.push({ "data": i, "name": i, "autovalue" : true });

then add it into my dt as

columns: [
Nomi
]

but I'm always getting error 'Cannot read property 'sWidth' of undefined'....
Any ideas?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946
    Answer ✓

    Your variable Nomi is already an array so you would just have this:

    columns: Nomi,

    With what you have you are adding an array containing an array of objects, something like this: [ [ {}, {}, ...] ]

    As far as I know there is no columns option called autovalue. Shouldn't give an error but won't do anything. What are you trying to do with this option?

    Kevin

  • freecexfreecex Posts: 25Questions: 4Answers: 0

    Wow!
    ty man! Problem was [] after Colum property!!!!

    Thanks a lot!

This discussion has been closed.