25 Temmuz 2016 Pazartesi

BAKILACAK KONULAR:

1-)Changing the color of a clicked table row using jQuery


http://stackoverflow.com/questions/17703710/changing-the-color-of-a-clicked-table-row-using-jquery

http://jsfiddle.net/jrthib/HVw7E/2/

http://www.mkyong.com/jquery/how-to-highlight-table-row-record-on-hover-with-jquery/

2-)How to get a table cell value using jQuery?

http://stackoverflow.com/questions/376081/how-to-get-a-table-cell-value-using-jquery



3-) Pass input tag value to as href parameter

http://stackoverflow.com/questions/27148673/pass-input-tag-value-to-as-href-parameter


form açıldığında ilk kayıt seçili olsun

<button id="button"> Highlight row </button>
<script type="text/javascript">


        //$("#tableData >tbody > tr:last").css({"background": "papayawhip", "font-weight":"bold"})        $("#tableData tbody tr:eq(1)").removeClass('highlighted');
        $("#tableData tbody tr:eq(1)").addClass('highlighted');
        var customerId = $("#tableData").find("td:first").html();
        $('#customerid').val(customerId);//alert(customerId);
    //alert(customerId);
</script>

5 Temmuz 2016 Salı

İKİ TARİH ARASI FİLTRELEME:

Sql'de

s:='select * from satis where musteriid='+musteriid+
  ' and tarih>'''+t1+''' and tarih<='''+t2+'''';

iki tarih arası filtreleme django'da yapmak için alan adının 
sonuna __range=(parametre1,parametre2) ilave edilir.
Örnek tarih__range=(t1,t2) 




import datetime
tt1 = request.POST.get('datepicker1') #"2016-06-02"#tt2 = request.POST.get('datepicker2')
t1=datetime.datetime.strptime(tt1, '%d/%m/%Y').strftime('%Y-%m-%d')
t2=datetime.datetime.strptime(tt2, '%d/%m/%Y').strftime('%Y-%m-%d')
musteri_id = request.POST.get('dropdown')
musteri = Musteri.objects.get(id=musteri_id)
satislar = Satis.objects.filter(musteri=musteri,tarih__range=(t1,t2))