Server side processing - form data order as name

Server side processing - form data order as name

markzzzmarkzzz Posts: 49Questions: 8Answers: 1

Hi,

is there a way to send within the payload of ajax request (server side processing) the "name" of the column, not the progressive number?

I see something like this:

order[0][column]: 2
order[0][dir]: asc

where 2 on server means "nothing" (it will be somethings like "Surname", "Region", "Country", and so on).

Can I set the name of the column instead of the progressive number on the request?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    At the moment, what you need to do is look that 2 up in the columns array that is also submitted. e.g.

    var idx = http.order[0][column];
    var column = http.columns[idx];
    
    column.name
    column.data
    

    The name parameter for the column comes from columns.name, if you set that, and data from columns.data (which you probably already have).

    Allan

  • markzzzmarkzzz Posts: 49Questions: 8Answers: 1

    It works, thanks!

Sign In or Register to comment.