Jump to content


Customization issue with JQuery

Jquery Customization

  • Please log in to reply
1 reply to this topic

#1 josemalcher

josemalcher

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 29 July 2019 - 06:10 PM

Hello
I'm posting for the first time, this forum has always helped me a lot!
 
Well, I have the following problem. View images!

 

I am using the following codes to change the state in the table:

 

duvida-1-grocery.PNG

 

duvida-2-grocery.PNG

```

if ($priority == 0) {
return '<span class="pedido_realizado" style="color:#60676a;"></span>';
}
if ($checkout_Y == -0001 && $checkin_Y == -0001) {
return '<span class="aguardando_checkin" style="color:#60676a;"></span>';
}
if($checkout_Y != -0001 && $checkin_Y != -0001){
return '<span class="completo_in_out" style="color:#60676a;"></span>';
}

 

```

 

```

$(document).ready(function () {
$('.completo_in_out').parent().parent().addClass( "success").find('a').addClass( "hidden" );
$('.pedido_realizado').parent().parent().addClass( "info" ).find('a').addClass( "hidden" );
$('.aguardando_checkin').parent().parent().addClass( "warning" );

});

 

```

Has anyone been through this situation ... or similar?
 
Need help!
 
Thank you!! Hugs to all!

 

 



#2 josemalcher

josemalcher

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 30 July 2019 - 07:35 PM

The only solution I found so far was to change the file:
 
 

assets/grocery_crud/themes/bootstrap/views/list_tbody.php

<script>
    $(document).ready(function () {
        $('.completo_in_out').parent().parent().addClass( "success").find('a').addClass( "hidden" );
        $('.pedido_realizado').parent().parent().addClass( "info" ).find('a').addClass( "hidden" );
        $('.aguardando_checkin').parent().parent().addClass( "warning" );

        $('#clock').countdown('2019/07/30 20:30:00', function(event) {
            $(this).html(event.strftime('%D dias e %H:%M:%S'));
        });
    });
</script>
 
But... in console chrome:
 
Uncaught ReferenceError: $ is not defined
    at simulaOperacoes:689
(anonymous) @ simulaOperacoes:689

 
If anyone has any tips how can I adjust and maintain this file without changing the core!
 
Hugs






Also tagged with one or more of these keywords: Jquery, Customization

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users