Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82012

Not sure how to modify sDom

$
0
0
FYI, never used live.datatables.net, but tried it and my code should be here: http://live.datatables.net/ovuyul

I'm using twitter bootstrap and have a custom theme (bought on WrapBootstrap, nl. Unicorn Admin Theme)
From the demo, I'm supposed to use datatables as follows, which works great on tables I create when the page load:
$('#tblItems').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<""l>t<"F"fp>'
});

However, I needed to get server side processing working, and followed this article: http://www.codeproject.com/Articles/155422/jQuery-DataTables-and-ASP-NET-MVC-Integration-Part

Works fantastic as well, though the code used in that article render my table funny (guess because of my custom theme)

So combining what I had and this I ended up with the following:
$(document).ready(function () {
var url = '@Url.Action(MVC.ClientArea.Member.AjaxHandler())';
$('#tblItems').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<""l>t<"F"fp>',
"bServerSide": true,
"sAjaxSource": url,
"bProcessing": true,
"aoColumns": [
{
"sName": "Id",
"bSearchable": false,
"bSortable": false
},
{ "sName": "Name" },
{ "sName": "Company" },
{ "sName": "IdentityNumber" },
{ "sName": "CellPhoneNumber" }
]
});
});

However, unless I comment out ""sDom": '<""l>t<"F"fp>'," I will this error in FireFox:
TypeError: an is undefined : for ( var i=0, iLen=an.length ; i<iLen ; i++ )
in jquery.dataTables.js (version 1.9.2)

When I comment out that line, it works fine, but my table look funny in the sense that my pagination bar is hanging down there over the bottom edge of the table.

I'm really not sure what I should be posting here, so please try bear with me?

Viewing all articles
Browse latest Browse all 82012

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>