malihehshajari
شنبه 30 فروردین 1393, 10:29 صبح
سلام من کد زیر رو نوشتم که یک باتن پرینت داره و با زدن اون باتن پرینتر فراخوانی میشه من میخوام فقط اون پنجره ای که روی صفحه باز شده پرینت بشه ولی این کد اون پنجره رو پرینت نمیگیره کل صفحه رو پرینت میگیره چرا ؟
$('#add_recept_print').click(function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: "/insert_print_reception/", //**Your full URL goes here**
data: $('#frm_reception').serialize(),
dataType: 'json',
success: function(data, textStatus, jqXHR){
$("#error_recept").html(data.errors);
$("#len_test").html(data.len_test);
$("#tbl_test_reception").html(data.test_reseption_show);
$("#tbl_sample").html(data.sampels);
$("#date_recept").html(data.show_answering_date);
$("#answering_date").val(data.show_answering_date);
$("#mohasebat_mali").html(data.mali);
$("#insurance_name_list").val(data.insurance);
$("#container_print").html(data.print_ghabz);
if(data.print == 1 )
{
$("#container_print").dialog(
{
autoOpen : false,
resizable : false,
position : [150,10],
title : "پیش نمایش قبض" ,
minHeight : 100,
minWidth : 10,
height : 600,
width : 700 ,
dialogClass:'dialog_style1' ,
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close", ui.dialog || ui).hide();},
buttons: { "close": function() { $(this).dialog("close"); }
, "print": function() {window.print(); window.close() ;
$.ajax({
type: "POST",
url: "/reception_print_count/", //**Your full URL goes here**
data: $('#frm_reception').serialize(),
dataType: 'json',
success: function(data, textStatus, jqXHR){
$("#error_recept").html(data.errors);
$("#print_count_l").html(data.print_count);
},
error: function(jqXHR, textStatus, errorThrown){
alert(errorThrown);
}
});
$(this).dialog("close");
} }
}
);
$('#container_print').dialog('open');
}
},
error: function(jqXHR, textStatus, errorThrown){
alert(errorThrown);
}
});
});
میشه راهنمایی کنید
با تشکر
$('#add_recept_print').click(function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: "/insert_print_reception/", //**Your full URL goes here**
data: $('#frm_reception').serialize(),
dataType: 'json',
success: function(data, textStatus, jqXHR){
$("#error_recept").html(data.errors);
$("#len_test").html(data.len_test);
$("#tbl_test_reception").html(data.test_reseption_show);
$("#tbl_sample").html(data.sampels);
$("#date_recept").html(data.show_answering_date);
$("#answering_date").val(data.show_answering_date);
$("#mohasebat_mali").html(data.mali);
$("#insurance_name_list").val(data.insurance);
$("#container_print").html(data.print_ghabz);
if(data.print == 1 )
{
$("#container_print").dialog(
{
autoOpen : false,
resizable : false,
position : [150,10],
title : "پیش نمایش قبض" ,
minHeight : 100,
minWidth : 10,
height : 600,
width : 700 ,
dialogClass:'dialog_style1' ,
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close", ui.dialog || ui).hide();},
buttons: { "close": function() { $(this).dialog("close"); }
, "print": function() {window.print(); window.close() ;
$.ajax({
type: "POST",
url: "/reception_print_count/", //**Your full URL goes here**
data: $('#frm_reception').serialize(),
dataType: 'json',
success: function(data, textStatus, jqXHR){
$("#error_recept").html(data.errors);
$("#print_count_l").html(data.print_count);
},
error: function(jqXHR, textStatus, errorThrown){
alert(errorThrown);
}
});
$(this).dialog("close");
} }
}
);
$('#container_print').dialog('open');
}
},
error: function(jqXHR, textStatus, errorThrown){
alert(errorThrown);
}
});
});
میشه راهنمایی کنید
با تشکر