document on click marka function console log this parents cartridge_ro

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$(document).on('click','.marka', function()
{
// console.log($(this).parents('.cartridge_row').find('.marka').html());
var marka=$(this).parents('.cartridge_row').find('.marka').html().replace(' ', '');
// console.log(marka);
if ($('.'+marka).hasClass("hide"))
{
$.ajax({
url: "/index.php?controller=cartridge/ajax&action=search_cartridge_marka",
method: 'post',
dataType: 'json',
data: {
cartridge_marka:$(this).parents('.cartridge_row').find('.marka').html()
},
success: function(data)
{
$('.inventory_present.'+marka).html(data.inventory_present);
$('.inventory_exploitation.'+marka).html(data.inventory_exploitation);
// $('.inventory_locate.'+marka).html(data.inventory_locate);
$('.inventory_na_zapravku.'+marka).html(data.inventory_na_zapravku);
$('.inventory_na_firmi.'+marka).html(data.inventory_na_firmi);
$('.'+marka).toggleClass("hide");
// $('.tr_hide').toggleClass("hide");
}
});
}
else {$('.'+marka).toggleClass("hide");}
});