Two Tables in 1 View (Multiple Issues)
Two Tables in 1 View (Multiple Issues)
HendPro12
Posts: 3Questions: 0Answers: 0
Hi,
I am developing a c#.Net MVC4 application. I've created two datatables which are each located in separate partial views. Both partial views (PartialView1) and (PartialView2) are then loaded and displayed together in another view.
My problems are that: *FixedColumn functionality is not working for either table
*Sometimes one table will be correctly constrained to the div element boundaries in which its located and other times it
will stretch across the entire page (appears to occur randomly, this happens to both tables but it is always only one or
the other)
*First table always displays a footer with the selectable pages 1 & 2 although pagination is set to false
(this never occurs for the 2nd table)
Ive used firebug and inspect element in Chrome but do not see any script errors other than the one regarding the browser check incompatibility that is being fixed in the most current build of FixedColumn.
My debugger reference: ojoveq
I'm not familiar with how to use DataTables live or JS Fiddle to test my problems.
Table 1 Code:
[code]
$(document).ready(function () {
var oTable1 = $('#example1').dataTable({
"sScrollX": "0",
"sScrollY": "200px",
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false
});
new FixedColumns(oTable1, {
"iLeftColumns": 1,
"iLeftWidth": 200
});
});
[/code]
Table 2 Code:
[code]
$(document).ready(function () {
var oTable = $('#example').dataTable({
"bPaginate": false,
"sScrollX": "0",
"sScrollY": "200px",
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false
});
new FixedColumns(oTable, {
"iLeftColumns": 1,
"iLeftWidth": 200
});
});
[/code]
Combined View Code:
[code]
@if(ViewBag.SearchKey != null)
{
@Html.Action("PartialView1", "Home", (string)ViewBag.SearchKey)
@Html.Action("PartialView2", "Home", (string)ViewBag.SearchKey)
}
[/code]
I am developing a c#.Net MVC4 application. I've created two datatables which are each located in separate partial views. Both partial views (PartialView1) and (PartialView2) are then loaded and displayed together in another view.
My problems are that: *FixedColumn functionality is not working for either table
*Sometimes one table will be correctly constrained to the div element boundaries in which its located and other times it
will stretch across the entire page (appears to occur randomly, this happens to both tables but it is always only one or
the other)
*First table always displays a footer with the selectable pages 1 & 2 although pagination is set to false
(this never occurs for the 2nd table)
Ive used firebug and inspect element in Chrome but do not see any script errors other than the one regarding the browser check incompatibility that is being fixed in the most current build of FixedColumn.
My debugger reference: ojoveq
I'm not familiar with how to use DataTables live or JS Fiddle to test my problems.
Table 1 Code:
[code]
$(document).ready(function () {
var oTable1 = $('#example1').dataTable({
"sScrollX": "0",
"sScrollY": "200px",
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false
});
new FixedColumns(oTable1, {
"iLeftColumns": 1,
"iLeftWidth": 200
});
});
[/code]
Table 2 Code:
[code]
$(document).ready(function () {
var oTable = $('#example').dataTable({
"bPaginate": false,
"sScrollX": "0",
"sScrollY": "200px",
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false
});
new FixedColumns(oTable, {
"iLeftColumns": 1,
"iLeftWidth": 200
});
});
[/code]
Combined View Code:
[code]
@if(ViewBag.SearchKey != null)
{
@Html.Action("PartialView1", "Home", (string)ViewBag.SearchKey)
@Html.Action("PartialView2", "Home", (string)ViewBag.SearchKey)
}
[/code]
This discussion has been closed.
Replies
The browser check javascript error is removed also but all other issues are still present.