Can someone tell me where i'm going wrong here?
Can someone tell me where i'm going wrong here?
travis1234
Posts: 2Questions: 0Answers: 0
Ok I'm creating a table dynamically with the following code:
[code]
$(document).ready(function () {
$.ajaxSetup({ cache: true });
UpdateRecords();
var refreshId = setInterval(UpdateRecords, 100000);
});
// Process & load/show the XML Data
function UpdateRecords() {
UpdateITOPSITSupportSQ();
}
function UpdateITOPSITSupportSQ() {
$.ajax({
type: "GET",
url: "data/dsITOPSSupportSQ.XML",
dataType: "xml",
success: xmlParserITOPSSupportSQ
});
}
function xmlParserITOPSSupportSQ(xml) {
var i = 0;
$("table#ITOPSSupportSQ").empty().append("IDStatusDescriptionAssigneeDeadline");
$(xml).find("tblData").each(function () {
var colour, result;
result = $(this).find("Status").text();
switch (result) {
case "2": colour = "green"; break;
case "0": colour = "red"; break;
default: colour = "orange";
}
$("table#ITOPSSupportSQ").append(""
+ $(this).find("ID").text()
+ ""
+ $(this).find("Current_Status").text()
+ ""
+ $(this).find("DESCRIPTION").text()
+ ""
+ $(this).find("ASSIGNEE").text()
+ ""
+ $(this).find("DEADLINE").text()
+ ""
);
i++;
if (i == 500)
return false;
});
}
[/code]
And then I try and integrate DataTables with basic settings:
[code]
$(document).ready(function() {
$('#ITOPSSupportSQ').dataTable();
} );
[/code]
It seems to work IE10 but not Firefox for some reason.
If I use static tables hard coded into the html it works fine on both.
What am I do doing wrong?
Once I have figured out why it’s not working in firefox with basic settings I would like to set up Individual column filtering (using "select" elements) but it also doesn’t seem to work with my code.
If required I don't mind paying for support to get this working.
[code]
$(document).ready(function () {
$.ajaxSetup({ cache: true });
UpdateRecords();
var refreshId = setInterval(UpdateRecords, 100000);
});
// Process & load/show the XML Data
function UpdateRecords() {
UpdateITOPSITSupportSQ();
}
function UpdateITOPSITSupportSQ() {
$.ajax({
type: "GET",
url: "data/dsITOPSSupportSQ.XML",
dataType: "xml",
success: xmlParserITOPSSupportSQ
});
}
function xmlParserITOPSSupportSQ(xml) {
var i = 0;
$("table#ITOPSSupportSQ").empty().append("IDStatusDescriptionAssigneeDeadline");
$(xml).find("tblData").each(function () {
var colour, result;
result = $(this).find("Status").text();
switch (result) {
case "2": colour = "green"; break;
case "0": colour = "red"; break;
default: colour = "orange";
}
$("table#ITOPSSupportSQ").append(""
+ $(this).find("ID").text()
+ ""
+ $(this).find("Current_Status").text()
+ ""
+ $(this).find("DESCRIPTION").text()
+ ""
+ $(this).find("ASSIGNEE").text()
+ ""
+ $(this).find("DEADLINE").text()
+ ""
);
i++;
if (i == 500)
return false;
});
}
[/code]
And then I try and integrate DataTables with basic settings:
[code]
$(document).ready(function() {
$('#ITOPSSupportSQ').dataTable();
} );
[/code]
It seems to work IE10 but not Firefox for some reason.
If I use static tables hard coded into the html it works fine on both.
What am I do doing wrong?
Once I have figured out why it’s not working in firefox with basic settings I would like to set up Individual column filtering (using "select" elements) but it also doesn’t seem to work with my code.
If required I don't mind paying for support to get this working.
This discussion has been closed.
Replies