IE 7/8 Page Button Strange Behavior
IE 7/8 Page Button Strange Behavior
fieala
Posts: 3Questions: 0Answers: 0
In IE 7 and 8 using server side paging, the "Next" button behaves like the "First" button, the "First" button behaves like the "Previous" button and the "Previous" button behaves like the "Next" button. Has anyone run into this and what was the fix?
This discussion has been closed.
Replies
Allan
[code]
_Layout.cshtml
====================
DataTable.cshtml
====================
$(document).ready(function () {
var url = '@Html.Raw(@Url.Action("TableData"))';
$.ajax({
type: "GET",
url: url,
success: function (data) {
$("#tblActivity").dataTable({
"bFilter": false,
"bServerSide": true,
"sAjaxSource": url,
"bProcessing": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"sScrollY": "300px",
"sScrollX": "100%",
"bjQueryUI": true,
"aoColumnDefs": data.aoColumnDefs,
"aaData": data.aaData,
"bSort": false,
"iDisplayLength": 100
})
},
failure: function () { alert('failed'); }
})
});
HomeController.cs
====================
public JsonResult TableData(jQueryDataTableParamModel Params)
{
DataTable dt = new DataTable();
List rows = new List();
List colNames = new List();
int firstRow = Params.iDisplayStart;
if (firstRow < 0)
firstRow = 0;
int rowsPerPage = Params.iDisplayLength;
int lastRow = firstRow + rowsPerPage - 1;
using (SqlCommand cmd = new SqlCommand())
{
cmd.Connection = new SqlConnection(_cs);
cmd.CommandText = "SELECT TOP 10000 * FROM Activity ORDER BY id DESC";
using (SqlDataAdapter adp = new SqlDataAdapter(cmd))
{
adp.Fill(dt);
int count = dt.Columns.Count;
for (int c = 0; c < count; c++)
{
int[] arry = new int[1];
arry[0] = c;
colNames.Add(new { sTitle = dt.Columns[c].ColumnName, aTargets = arry });
}
for (int r = firstRow; r <= lastRow; r++)
{
List cols = new List();
for (int c = 0; c < dt.Columns.Count; c++)
{
string colName = dt.Columns[c].ColumnName.ToString(); ;
string colValue = dt.Rows[r][colName] == null ? string.Empty : dt.Rows[r][colName].ToString();
cols.Add(colValue);
}
rows.Add(cols);
}
}
}
var outJson = new
{
aaData = rows.ToArray(),
aoColumnDefs = colNames.ToArray(),
sEcho = Params.sEcho,
iTotalRecords = dt.Rows.Count,
iTotalDisplayRecords = dt.Rows.Count,
iDisplayStart = Params.iDisplayStart
};
return Json(outJson, JsonRequestBehavior.AllowGet);
}[/code]
http://agfirstmarketing.com/FarmCreditExpress/dealerships/dealerships.html
Is this a known bug? I've only seen this happen in IE8 as I don't have access to IE7 for testing functionality.
Allan
Allan, any chance this could have something to do with it?
Allan
my table id is "tblWFM" and the buttons on Chrome come out like this:
[code]
Previous
Last
[/code]
BUT on IE it comes out like this:
[code]
Previous
Last
[/code]
HELP!!
NOTE: I submitted a BUG...
- jquery-1.9.0.js
- jquery-ui-1.10.0.js
I have also tested with and without jquery-migrate-1.1.0.js. Same behavior in both situations.
When setting IE10 to:
Browser Mode: IE8
Document Mode: IE8 standards
It works fine though. Also on Firefox, Chrome, Opera, IE9, IE10 it works fine.
It get the following HTML in IE8 on XP:
[code]
Første
Forrige
2
3
4
5
6
Næste
Sidste
[/code]
Best regards
Søren
I am testing using IE8 on XP. The demo works fine in IE10 when set to IE8 mode. You said you tried it in IE8 where it worked. Was it really IE8 or was it IE9/10 put into IE8 mode?
In the posted demo (and on my own site) it seems like the back/next buttons have switched functionality. When I click 'previous' it works like clicking 'next' in other browsers and vice versa.
It is the same behavior I experience on my own website (I cannot post a demo unfortunately)
UPDATE:
I just upgraded some of the script libraries, so now I use:
- jquery-1.9.1.js
- jquery-ui-1.10.0.js
- jquery-migrate-1.1.1.js
which still does not work on IE8 on XP.
Allan
I was using jquery-1.9.0 and jquery-ui-1.10.0.
I fixed the problem by just upgrading to jquery-1.9.1. No migrate-plugin needed!