Hi pböttcher
you are right, sorry... the child table is Agenda and the parent is Clienti. I understood from the beginning of this post that I had to use:
".parent-child-field"
meanwhile I just need to write ".child-field" only so the code is ".Agenda-Stato"
With this last code it works perfectly.
thank you very much!
Highlighting Specific Records
Re: Highlighting Specific Records
Hi all
so the correct code (for any future request) to use to highlight the row of a childtable is:
<script>
$j(function() {
function wait_for(data,callback,time=100) {
if($j(data).length != 0) {
callback();
return;
}
else {
setTimeout(function() {
wait_for(data,callback, time);
}, time);
}
}
wait_for('.table-striped',function() {
$j('.TABLENAME-FIELDNAME').each(function(){
var Stato = $j(this).text();
if(FIELDNAME == 'RECORDNAME1'){
$j(this).parents('tr').addClass('warning');
}
if(FIELDNAME == 'RECORDNAME2'){
$j(this).parents('tr').addClass('danger');
}
if(FIELDNAME == 'RECORDNAME3'){
$j(this).parents('tr').addClass('success');
}
})
})
})
</script>
replace TABLENAME - FIELDNAME - RECORDNAME1 - RECORDNAME2 and RECORDNAME3 with your data or delete the RECORDNAMENUMBER part if you don't use.
I hope this helps
so the correct code (for any future request) to use to highlight the row of a childtable is:
<script>
$j(function() {
function wait_for(data,callback,time=100) {
if($j(data).length != 0) {
callback();
return;
}
else {
setTimeout(function() {
wait_for(data,callback, time);
}, time);
}
}
wait_for('.table-striped',function() {
$j('.TABLENAME-FIELDNAME').each(function(){
var Stato = $j(this).text();
if(FIELDNAME == 'RECORDNAME1'){
$j(this).parents('tr').addClass('warning');
}
if(FIELDNAME == 'RECORDNAME2'){
$j(this).parents('tr').addClass('danger');
}
if(FIELDNAME == 'RECORDNAME3'){
$j(this).parents('tr').addClass('success');
}
})
})
})
</script>
replace TABLENAME - FIELDNAME - RECORDNAME1 - RECORDNAME2 and RECORDNAME3 with your data or delete the RECORDNAMENUMBER part if you don't use.
I hope this helps
Re: Highlighting Specific Records
I have to open this post again because I have another problem... color the text:
This changes the entire column of the Prezzo (Price) in blue in the table view. Why it doesn't work for the child table? Of course it's inside the wait_for function
and why I can't see it detail view too?
Code: Select all
$j('.Listini_Clienti-LEPREZ').each(function(){
var Prezzo = $j(this).text();
if(Prezzo => 0){
$j(this).children('a').css('color',"#4dbbff")
}
})
and why I can't see it detail view too?
Re: Highlighting Specific Records
Hi,
because the child table does not have an "a" tag, so your $j(this).children('a') does not match anything.
because the child table does not have an "a" tag, so your $j(this).children('a') does not match anything.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Highlighting Specific Records
Thanks pböttcher
How can I fix it? I tried so many combinations
How can I fix it? I tried so many combinations
Re: Highlighting Specific Records
try
Code: Select all
$j('.Listini_Clienti-LEPREZ').each(function(){
var Prezzo = $j(this).text();
if(Prezzo => 0){
if ($j(this).children('a').length == 0) {
$j(this).css('color',"#4dbbff")
}
else {
$j(this).children('a').css('color',"#4dbbff")
}
}
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Highlighting Specific Records
You are magic!!! Thank you so much!!!