-
Ajax Animationextender Div Print
Hi...
I am using ajaxToolkit:AnimationExtender and I have the linkbutton (xela_lnk) inside a gridview1 column.
Then, when you click the linkbutton (xela_lnk) AnimationExtender open a new window (like float window) displaying a details of the invoice selected (or clicked).
Please, see my example below:
*************************************
<ItemTemplate>
<div align = "left">
<asp:LinkButton ID="xela_lnk" runat="server" Text='<%#Eval("INVOICE_NUMBER")%>' OnClientClick="return false;" />
<div id="xela_panel" style="display:none; overflow: hidden; z-index: 2; background-color: #FFFFFF; border: solid 1px #FFFFFF; position:absolute; left: 0; text-align:justify" runat = "server">
<div style="float:right;" id="xela_closeParent" runat = "server">
<A HREF="JavaScript rintPartOfPage('printDiv');" Style="text-align: right;border utset thin white; padding: 5px; text-decoration: none; background-color:#666666;color:White;text-align:center; right: 0; font-family:Verdana">Print This Invoice</A>
<asp:LinkButton id="xela_close" runat="server" OnClientClick="return false;" Text="" Style="text-align: right;border utset thin white; padding: 5px; text-decoration: none; background-color:#666666;color:White;text-align:center; right: 0; font-family:Verdana" ToolTip="Close">close</asp:LinkButton>
</div>
<div align = "center" id = "printDiv" contenteditable = "inherit" enableviewstate = "true">
<asp:Label ID="LABEL_DEMO" runat="server" Text = <%#xela_detail_number(Eval("CLIENT_ID"), EVAL("INVOICE_NUMBER"))%> />
</DIV>
</div>
<ajaxToolkit:AnimationExtender ID="xela_animation" TargetControlID="xela_lnk" EnableViewState = "true" runat="server">
<Animations>
<OnClick>
<Sequence>
<OpacityAction Opacity="0" />
<Parallel AnimationTarget="xela_panel" fps = "25" Duration="0.1">
<StyleAction Attribute="height" value="auto" />
<StyleAction Attribute="display" Value="block" />
<Color PropertyKey="backgroundColor" StartValue="#AAAAAA" EndValue="#FFFFFF" />
<Color PropertyKey="color" StartValue="#666666" EndValue="#FF0000" />
<Color PropertyKey="borderColor" StartValue="#666666" EndValue="#FF0000" />
</Parallel>
<Parallel Duration=".2">
<FadeIn/>
</Parallel>
<ScriptAction Script="printPartOfPage('printDiv');" />
</Sequence>
</OnClick>
</Animations>
</ajaxToolkit:AnimationExtender>
************************************************
And the JAVASCRIPT for capture the clicked panel:
************************************************
<script>
function printPartOfPage(elementId)
{
var printContent = document.getElementById(elementId);
var windowUrl = 'about:blank';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
alert(printContent.innerHTML)
}
</script>
******************************************
My code is working fine. I am getting LABEL_DEMO show me the real value clicked.
However, when I press the link "print this invoice" for print the REAL PAGE displayed, it is open the print panel to select the printer and I send this to print, but when I go to see the page printed, this is printing the detail invoice of the FIRST COLUMN and not the information clicked.
Example, I have a invoice list like:
Invoice No. 01
Invoice No. 02
Invoice No. 03
Invoice No. 04
Invoice No. 05
Invoice No. 06
I click
Invoice No. 04 and it is showing the detail well, but when I send to my printer, it is printing the detail of Invoice No. 01
Please, any suggest to help me, I could be fine...
Similar Threads
-
By oranged in forum VB Classic
Replies: 2
Last Post: 07-19-2006, 06:50 AM
-
Replies: 0
Last Post: 02-09-2006, 01:26 PM
-
By Hamish in forum VB Classic
Replies: 3
Last Post: 10-31-2002, 04:19 PM
-
By malikmehmood in forum Database
Replies: 0
Last Post: 11-20-2000, 05:12 AM
-
Replies: 2
Last Post: 03-24-2000, 01:05 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks