How to create column spanned top header in JS model?

How to create column spanned top header in JS model?

vorodotvorodot Posts: 1Questions: 1Answers: 0
edited January 17 in Free community support

Hi,

because it is hard to me to find sample but how can I extend my setup model to add one top span header over the first two columns and additional header over the third column?

I found an example but it setups the dom model instead of the JS model.

I need to start from the JS model

$("#topicsGrid").DataTable({
processing: !0,
serverSide: !0,
ajax: {
url: "/GetData"
},
scrollX: !0,
info: !0,
paging: !0,
pagingType: "simple_numbers",
columns: [{
title: "First Name",
width: "300",
visible: !0,
searchable: !1,
data: "FirstName"
}, {
title: "Last Name",
width: "300",
visible: !0,
searchable: !1,
data: "LastName"
}, {
title: "Age",
width: "300",
visible: !0,
searchable: !1,
data: "Age"
}]
}

Answers

  • allanallan Posts: 63,434Questions: 1Answers: 10,458 Site admin

    DataTables' initialisation options do not provide a way to create a complex header (i.e. colspan / rowspan). You need to create it using standard DOM methods if you need to create it using Javascript, rather than just having it in the HTML source.

    Allan

Sign In or Register to comment.