This javascript works to a point because it will open popups as required, but they are empty! What is the syntax to pass in the two missing values for the function? The two values need to be taken from the gridview (lblEVENT_DATE & the BoundField with a DataField of DETAILS). As you will see the function opens a modal popup and is called by an input button from the gridview. The third required value in the function is hard coded.
function OpenPopup(datetime, text, mode) {
if (mode == 'track') {
$('#lblDateTime').text(datetime);
$('#lblTrackingNotes').text(text);
$("#divTrackingNotes").dialog({ title: "Tracking Notes", width: 700, modal: true, });
}
else {
$('#lblRCAComments').text(text);
$("#divRCAComments").dialog({ title: "Comments", width: 700, modal: true, });
}
}
<asp:GridView ID="GridRootCause" ClientIDMode="Static" CssClass="dataTable fullWidth spaceAfter2" runat="server" AutoGenerateColumns="False" DataKeyNames="ROOT_CAUSE_IDENTIFIER,RECORD_IDENTIFIER">
<Columns>
<asp:BoundField DataField="RECORD_IDENTIFIER" ItemStyle-CssClass="hiddenColumn" HeaderStyle-CssClass="hiddenColumn" />
<asp:TemplateField HeaderText="Event Date">
<ItemTemplate>
<asp:Label ID="lblEVENT_DATE" runat="server" Text='<%# CDate(Eval("EVENT_DATE")).ToString("ddd") & " " & Eval("EVENT_DATE")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Details">
<ItemTemplate>
<asp:Label Visible="false" Wrap="true" ID="lblDetails" runat="server" />
<input type="button" class="innerButton buttonBlue" id="btnTrackingNotes" onclick="javascript: OpenPopup('','','track');" Visible="false" runat="server" value="Tracking Notes" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comments" HeaderStyle-CssClass="width150">
<ItemTemplate>
<input type="button" class="innerButton buttonBlue" id="btnComments" onclick="javascript: OpenPopup('','','comm');" Visible="false" runat="server" value="Comments" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>