getting a hidden column's value based on a relative cell
getting a hidden column's value based on a relative cell
Hi, very confused here so I apologise if my confusion comes across and I end up repeating myself alot, tends to happen when i'm confused!
basically I have a table initialisation that looks like this -
[code]var oTable = $('#dataTable').dataTable({
"bProcessing": false,
"bPaginate": true,
"sAjaxSource": "csv-reader.php" ,
"iDisplayLength": 10,
"bLengthChange": false,
"bFilter": false,
"bStateSave": false,
"aoColumns": [
{ "mDataProp": "Agent" },
{ "mDataProp": "Target" },
{ "mDataProp": "Pcks Out" },
{ "mDataProp": "PPI" },
{ "mDataProp": "CC PPI" },
{ "mDataProp": "CCC" },
{ "mDataProp": "Totals" },
{ "mDataProp": "Type" , "bVisible" : false , "bSearchable" : true }
],
"aoColumnDefs": [
{ "sClass": "actual_out", "aTargets": [ 2 ] },
{ "sClass": "target_out", "aTargets": [ 1 ] }
],
"fnInitComplete": function() {
flagHourly();
$('.target_out').css('background','#2679E0');
}
});[/code]
basically what I am trying to do is build a flag hourly function that has conditional statements that are based upon the values of a hidden columns cell in reference to another cell in that row -
i know that the hidden columns arn't actually placed in the dom so I can't use a simple jquery selector, but if they were this is what my function would look like - (assuming i'd have assigned a class to each cell in the hidden column call 'job_type')
$('.actual_out').each(function() {
var jobType = $(this).siblings('.job_type').text();
if ( jobType == 'value' ) {
do something..
}
});
I hope that clarifys what i'm trying to do - i guess to summise my problem is getting a hidden cells value, when referencing it as relative to another cell in that row lol probably could have saved alot of typing with that one line!
Thanks in advance, any help is much appreciated!
basically I have a table initialisation that looks like this -
[code]var oTable = $('#dataTable').dataTable({
"bProcessing": false,
"bPaginate": true,
"sAjaxSource": "csv-reader.php" ,
"iDisplayLength": 10,
"bLengthChange": false,
"bFilter": false,
"bStateSave": false,
"aoColumns": [
{ "mDataProp": "Agent" },
{ "mDataProp": "Target" },
{ "mDataProp": "Pcks Out" },
{ "mDataProp": "PPI" },
{ "mDataProp": "CC PPI" },
{ "mDataProp": "CCC" },
{ "mDataProp": "Totals" },
{ "mDataProp": "Type" , "bVisible" : false , "bSearchable" : true }
],
"aoColumnDefs": [
{ "sClass": "actual_out", "aTargets": [ 2 ] },
{ "sClass": "target_out", "aTargets": [ 1 ] }
],
"fnInitComplete": function() {
flagHourly();
$('.target_out').css('background','#2679E0');
}
});[/code]
basically what I am trying to do is build a flag hourly function that has conditional statements that are based upon the values of a hidden columns cell in reference to another cell in that row -
i know that the hidden columns arn't actually placed in the dom so I can't use a simple jquery selector, but if they were this is what my function would look like - (assuming i'd have assigned a class to each cell in the hidden column call 'job_type')
$('.actual_out').each(function() {
var jobType = $(this).siblings('.job_type').text();
if ( jobType == 'value' ) {
do something..
}
});
I hope that clarifys what i'm trying to do - i guess to summise my problem is getting a hidden cells value, when referencing it as relative to another cell in that row lol probably could have saved alot of typing with that one line!
Thanks in advance, any help is much appreciated!
This discussion has been closed.