Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Contributor
2501 Points
2112 Posts
Sep 28, 2011 07:01 AM|LINK
Hi,
Since I am using JQuery Tools Tooltip, I found a similar question as follows:
http://flowplayer.org/tools/forum/30/39282
And I tried to change the JQuery as follows:
$(document).ready(function () { $("table[id*=GridView1] span[id*=LastDeliveryDate]").tooltip({ delay: 0, offset: [-65, -110], position: 'center top', onBeforeShow: function () { debugger var VendorID = $("table[id*=GridView1] span[id*=LastDeliveryDate]").closest("tr").find("span[id*=VendorNo]").text(); var ItemID = $("table[id*=GridView1] span[id*=LastDeliveryDate]").closest("tr").find("input[type=hidden][id*=itemID]").val(); theUrl = this.getTrigger().attr("table[id*=GridView1] span[id*=LastDeliveryDate]"); getAjaxData(theUrl, this.getTip()); } }); function getAjaxData(theUrl, $tip) { debugger $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "VendorRequest.aspx/getLastRequest", data: "{'VendorID': '" + VendorID + "','ItemID': '" + ItemID + "'}", dataType: "json", success: function (msg) { //alert(msg.d); $tip.html(msg.d); } }); } });I have 2 sample rows in this GridView and the VendorID on BeforeShow is returning both rows VendorID. How can Ifix this ???Here is GridView markup:...
asp:TemplateField HeaderText="Vendor No" SortExpression="VendorID" ItemStyle-Width="140px"> <ItemTemplate> <asp:Label ID="VendorNo" runat="server" Text='<%# Bind("VendorID") %>'></asp:Label> <div id="tooltip4" class="tooltip4"> <div> <%# Eval("requesttype")%><br /> </div> </div> </ItemTemplate> <ItemStyle Width="140px" /> </asp:TemplateField> <asp:BoundField HeaderText="Request Date" DataField="RequestDate" SortExpression="RequestDate" ReadOnly="True" DataFormatString="{0:dd MMMM yyyy}" HtmlEncode="false" ItemStyle-Width="150px"> <ItemStyle Width="150px" /> </asp:BoundField> <asp:TemplateField HeaderText="Item Name" SortExpression="ItemName" ItemStyle-Width="150px"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("ItemName") %>'></asp:Label> <asp:HiddenField ID="itemID" runat="server" Value='<%#Eval("ItemID") %>' /> </ItemTemplate> <ItemStyle Width="135px" /> </asp:TemplateField> <asp:TemplateField HeaderText="Pack Amount" SortExpression="PackAmount" ItemStyle-Width="140px"> <EditItemTemplate> <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource3" DataTextField="PackAmount" DataValueField="PackageID" OnSelectedIndexChanged="DropDownList2_IndexChanged" AutoPostBack="true" CssClass="ddl"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:LPConnectionString %>" SelectCommand="Select [PackAmount],[PackageID] from [Packages] where [ItemID] = @ItemID order by PackAmount asc"> <SelectParameters> <asp:Parameter Name="ItemID" Type="Int32" DefaultValue="1" /> </SelectParameters> </asp:SqlDataSource> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("PackAmount") %>'></asp:Label> </ItemTemplate> <ItemStyle Width="140px" /> </asp:TemplateField> <asp:TemplateField HeaderText="Quantity" SortExpression="Quantity" ItemStyle-Width="150px"> <EditItemTemplate> <asp:TextBox ID="Quantity" runat="server" Text='<%# Bind("Quantity") %>' Columns="5" MaxLength="2" CssClass="calculate"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="None" ControlToValidate="Quantity" ErrorMessage="You must enter Quantity" SetFocusOnError="True"> </asp:RequiredFieldValidator> <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="Quantity" Operator="DataTypeCheck" Type="Integer" ErrorMessage="You must enter a number" Font-Bold="True" SetFocusOnError="True" Display="None"></asp:CompareValidator> <asp:RegularExpressionValidator ID="RegularExpressionValidator3" ControlToValidate="Quantity" ValidationExpression="^\d+(\,\d{1,4})?$" ErrorMessage="You must enter a positive number" EnableClientScript="true" runat="server" SetFocusOnError="True" Display="None" /> <asp:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1" TargetControlID="RequiredFieldValidator1" Width="200px" HighlightCssClass="highlight"> </asp:ValidatorCalloutExtender> <asp:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2" TargetControlID="CompareValidator1" Width="200px" HighlightCssClass="highlight"> </asp:ValidatorCalloutExtender> <asp:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3" TargetControlID="RegularExpressionValidator3" Width="200px" HighlightCssClass="highlight"> </asp:ValidatorCalloutExtender> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("Quantity") %>'></asp:Label> </ItemTemplate> <ItemStyle Width="150px" /> </asp:TemplateField> <asp:TemplateField HeaderText="Total" SortExpression="Total" ItemStyle-Width="150px"> <EditItemTemplate> <asp:Label ID="Label5" runat="server" Text='<%# Eval("Total") %>' CssClass="lbl"></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label4" runat="server" Text='<%# Bind("Total") %>'></asp:Label> </ItemTemplate> <ItemStyle Width="150px" /> </asp:TemplateField> <asp:BoundField HeaderText="Monthly Consumption" DataField="MonthlyConsumption" SortExpression="MonthlyConsumption" ReadOnly="True" ItemStyle-Width="150px"> <ItemStyle Width="150px" /> </asp:BoundField> <%--<asp:BoundField HeaderText="Last Delivery Date" DataField="DeliveryDate" SortExpression="DeliveryDate" ReadOnly="True" DataFormatString="{0:dd MMMM yyyy}" HtmlEncode="false" ItemStyle-Width="150px"> <ItemStyle Width="150px" /> </asp:BoundField>--%> <asp:TemplateField HeaderText="Last Delivery Date" SortExpression="DeliveryDate" ItemStyle-Width="150px"> <ItemTemplate> <asp:Label ID="LastDeliveryDate" runat="server" Text='<%# Bind("DeliveryDate","{0:dd MMMM yyyy}") %>' CssClass="anchor1"></asp:Label> <div id="tooltip999"> </div> </ItemTemplate> <ItemStyle Width="150px" /> </asp:TemplateField>
cenk1536
Contributor
2501 Points
2112 Posts
Re: JQuery mouse over Question?
Sep 28, 2011 07:01 AM|LINK
Hi,
Since I am using JQuery Tools Tooltip, I found a similar question as follows:
http://flowplayer.org/tools/forum/30/39282
And I tried to change the JQuery as follows: