Server-Side Processing

Server-Side Processing

Dooks123Dooks123 Posts: 4Questions: 0Answers: 0
edited December 2013 in General
Hi,

I am busy implementing the datatables plugin on an asp.net GridView table.
I make use of the two datatable "Extras" ColVis and ColReorder.

I am already sorted with the server-side processing
Source: http://activeengine.net/tag/datatables-net-paging/

The problem comes in when the table is rendered,
Previously I had a template field in my GridView with 4 fields inside, 3 image fields and a normal data field
[code]










[/code]

The three images are set according to the boolean fields, if it is true then use the one image else the other
Note that the boolean fields are not shown as columns in the data table, only the link lable JobNo

I have tried including the boolean fields in the table and using them via "aoColumnDefs"
[code]
"aoColumnDefs": [
{ "fnRender": function (oObj) {
return "
" + oObj.aData[0] + "

";
},
"sName": "JobNo",
"bSearchable": true,
"bSortable": true,
"bVisible": true,
"aTargets": [0]
},...
[/code]
But the problem with this is that the ColVis still lists the boolean fields and therefore it is not plausable.
The bVisible doesnt hide them from the selectable fields with ColVis

Is there a way to pass the datakeys from the server and use them within aoColumnDefs without actually rendering them clientside in the table first?

Thank you for the help in advance

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You can use ColVis' aiExclude option if you have a column which you don't want to be in its selectable list: http://datatables.net/extras/colvis/options#aiExclude .

    Allan
  • Dooks123Dooks123 Posts: 4Questions: 0Answers: 0
    Ah, thank you for your speedy reply Allan

    This will be the exact outcome!

    Thank you once again for your awesome work
This discussion has been closed.