Column widths and scroll bar on change number of records per page
Column widths and scroll bar on change number of records per page
infoheights
Posts: 7Questions: 0Answers: 0
Here is the link I am referring to in this discussion ..
http://www.infoheights.com/AOA/UserModule/indexmorecolumns.html
The issue is that when i change the Number of records per page, the vertical scroll bar comes up on every alternate change, so for e.g. if i change from 10 to 25 it comes, then when i go to 50 it doesnt come. Besides whenever the vertical scroll bar does appear, the columns get all misaligned.
I am using jquery-1.7.2.min.js and jquery-ui-1.8.21.custom.min.js and jquery.dataTables.min - ver 1.9.4
Following is my code for datatable initialization
[code]
var oTable = $('#studenttable').dataTable({
"bJQueryUI":"true",
"sDom": 'z<"row-fluid"<"span4"C><"span4 lineitemcheckbox"><"span3"l>r><"row-fluid"<"span4 actiondropdown"><"span4"f><"span4 advsearch">><"row-fluid"<"span12 newrecordbutton">><"datatable-scroll"t><"row-fluid"<"span12"i><"span12 center"p>>',
"oColVis": {
"aiExclude": [ 0,1 ],
"sAlign": "left"
},
/*"sPaginationType": "bootstrap",*/
"bJQueryUI": true,
// Disable sorting on the first column
"aoColumnDefs" : [ {
'bSortable' : false,
'aTargets' : [ 0 ]
} ],
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"sScrollX":"100%",
"sScrollXInner": "110%",
"sScrollY": ( 0.6 * $(window).height() ),
"bScrollCollapse": true,
"bAutoWidth":false
} );
//.fnDraw()
//.fnAdjustColumnSizing()
//oTable.fnAdjustColumnSizing();
var asInitVals = new Array();
$("tfoot input").keyup( function () {
/* Filter on the column (the index) of this element */
//alert($("tfoot input").index(this));
//var i = $("tfoot input").index(this);
oTable.fnFilter( this.value, ($("tfoot input").index(this))+1 );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer*/
$("tfoot input").each( function (i) {
asInitVals[i] = this.value;
} );
$("tfoot input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("tfoot input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
} );
//oTable.fnAdjustColumnSizing();
/* setTimeout(function ()
{
oTable.fnAdjustColumnSizing();
}, 10 );*/
//oTable.fnDraw();
$("div.advsearch").html('Advanced Search
');
$("div.actiondropdown").html('Actions Option 1Option 2Option 3Option 4Option 5');
$("div.sortdropdown").html('Sort IndividualSequentialOriginal');
$("div.lineitemcheckbox").html('Show Line Item Records ');
$("div.newrecordbutton").html(' Create a new record
');
[/code]
Please help!!
http://www.infoheights.com/AOA/UserModule/indexmorecolumns.html
The issue is that when i change the Number of records per page, the vertical scroll bar comes up on every alternate change, so for e.g. if i change from 10 to 25 it comes, then when i go to 50 it doesnt come. Besides whenever the vertical scroll bar does appear, the columns get all misaligned.
I am using jquery-1.7.2.min.js and jquery-ui-1.8.21.custom.min.js and jquery.dataTables.min - ver 1.9.4
Following is my code for datatable initialization
[code]
var oTable = $('#studenttable').dataTable({
"bJQueryUI":"true",
"sDom": 'z<"row-fluid"<"span4"C><"span4 lineitemcheckbox"><"span3"l>r><"row-fluid"<"span4 actiondropdown"><"span4"f><"span4 advsearch">><"row-fluid"<"span12 newrecordbutton">><"datatable-scroll"t><"row-fluid"<"span12"i><"span12 center"p>>',
"oColVis": {
"aiExclude": [ 0,1 ],
"sAlign": "left"
},
/*"sPaginationType": "bootstrap",*/
"bJQueryUI": true,
// Disable sorting on the first column
"aoColumnDefs" : [ {
'bSortable' : false,
'aTargets' : [ 0 ]
} ],
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"sScrollX":"100%",
"sScrollXInner": "110%",
"sScrollY": ( 0.6 * $(window).height() ),
"bScrollCollapse": true,
"bAutoWidth":false
} );
//.fnDraw()
//.fnAdjustColumnSizing()
//oTable.fnAdjustColumnSizing();
var asInitVals = new Array();
$("tfoot input").keyup( function () {
/* Filter on the column (the index) of this element */
//alert($("tfoot input").index(this));
//var i = $("tfoot input").index(this);
oTable.fnFilter( this.value, ($("tfoot input").index(this))+1 );
} );
/*
* Support functions to provide a little bit of 'user friendlyness' to the textboxes in
* the footer*/
$("tfoot input").each( function (i) {
asInitVals[i] = this.value;
} );
$("tfoot input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("tfoot input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("tfoot input").index(this)];
}
} );
//oTable.fnAdjustColumnSizing();
/* setTimeout(function ()
{
oTable.fnAdjustColumnSizing();
}, 10 );*/
//oTable.fnDraw();
$("div.advsearch").html('Advanced Search
');
$("div.actiondropdown").html('Actions Option 1Option 2Option 3Option 4Option 5');
$("div.sortdropdown").html('Sort IndividualSequentialOriginal');
$("div.lineitemcheckbox").html('Show Line Item Records ');
$("div.newrecordbutton").html(' Create a new record
');
[/code]
Please help!!
This discussion has been closed.
Replies