v2.5.2
Giriş yap

Konsolda çalışan sayfada çalışmayan each

polev
300 defa görüntülendi

Merhaba, sayfa yüklendikten sonra sessionda tutulan verileri tabloya append ile ekliyorum. Daha sonra inputların namelerine göre değerlerini almam gerekiyor.Kodu konsola girince düzgün bir şekilde çalışıyor ama js dosyasında sayfa yüklendikten sonra çalıştırsam bile çalışmıyor hatam nerede ?

Append : 
batchList.last().append
('<div class="table row column-row" role="rowgroup" id="st' + Barkod + '" data-barcode="' + Barkod + '"> ' +
' <div class="column column-wrap sticky">' +
' <div class="column" role="columnheader"><input type="checkbox" autocomplete="off" data-barcode="' + Barkod + '" required /></div>' +
' <div class="column" role="columnheader" name="barkod">' + Barkod + '</div>' +
' <div class="column" role="columnheader" name="title" style="width:200px"><input type="text" autocomplete="off" name="title" class="titleİnput" value="' + product.urunadi + '" required /></div>' +
' </div>' +
' <div class="column" role="columnheader"><input type="number" name="miktar" autocomplete="off" placeholder="" value="1" required /></div>' +
' <div class="column" role="columnheader"><input type="text" /></div>' +
' <div class="column" role="columnheader"><input type="text" name="kategori" autocomplete="off" placeholder="" value="' + product.kategori + '" required /></div>' +
' <div class="column" role="columnheader"><input type="text" name="kategori" autocomplete="off" placeholder="" value="' + product.altkategori + '" required /></div>' +' <div class="column" role="columnheader"><input type="text" name="marka" autocomplete="off" placeholder="" value="' + product.marka + '" required /></div>' +
' <div class="column" role="columnheader"><input type="number" name="stok" autocomplete="off" placeholder="" value="' + product.stok + '" required /></div>' +
' <div class="column" role="columnheader"><input type="number" name="alisfiyat" autocomplete="off" placeholder="" value="' + product.afiyati + '" required/></div>' +
' <div class="column" role="columnheader"><input type="number" name="iskonto1" autocomplete="off" placeholder="" value="' + product.iskonto1 + '" required/></div>' +
' <div class="column" role="columnheader"><input type="number" name="iskonto2" autocomplete="off" placeholder="" value="' + product.iskonto2 + '" required /></div>' +
' <div class="column" role="columnheader"><input type="number" name="iskonto3" autocomplete="off" placeholder="" value="' + product.iskonto3 + '" required /></div>' +
' <div class="column" role="columnheader"><input type="number" name="kdv" autocomplete="off" placeholder="" value="' + product.kdv + '" required /></div>' +
' <div class="column" role="columnheader"><input disabled type="number" name="alisfiyatkdv" autocomplete="off" placeholder="" value="' + product.afiyatikdv + '" required /></div>' +
' <div class="column" role="columnheader"><input disabled type="number" name="karorani" autocomplete="off" placeholder="" value="0" required /></div>' +
' <div class="column" role="columnheader"><input type="number" name="fiyat" autocomplete="off" placeholder="" value="' + product.fiyat + '" required /></div>' +
'</div>');

Konsolda çalışan sayfada çalışmayan kod:

Each : 

$('.wrapper #batchList').find("input[name=stok]").each(function() {
    alert("dsa")
});
Cevap yaz
Cevaplar (1)
polev
1035 gün önce

Çözüm :

  $(document).ready(function () {
    $(window).on("load", function () {
        profitCalculation();
    });
  });