Can I use columns name option for any purpose?

Can I use columns name option for any purpose?

wyattbikerwyattbiker Posts: 25Questions: 14Answers: 0

I am wondering what the effect is in DT, or is it something I could use for other purposes?
Eg.

 columns: [   
       { data: 'Region',name: {x:1,y:2,z:'abcd'} } 
       { data: 'Customer',name: {somefunc: 'custom'} } 
  ]

Can I just use it to pass along some custom info to the backend? It seems to be sent to the serverside correctly. Is there some other issue that may occur (didn't notice anything but want to double check)

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    At one point, I was using "name" to store the name of the data base table name.

    however, I now use the data:function(dtParms) inside the ajax call (serverSide:true) and add anything I need to pass to the server to added to the dt Parms

  • wyattbikerwyattbiker Posts: 25Questions: 14Answers: 0

    That's what I do (use the ajax data:function), but this name attribute is convenient and easy to use on a per data column basis. Would like to confirm if there is a specific use in DT.

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin

    The columns.name option is currently really only useful as a column selector (column-selector). It should be a string rather than anything else.

    I'm planning to expand upon that functionality in future, but it has limited use just now.

    Allan

This discussion has been closed.