--- Caller
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"><script type="text/javascript">
function rowEdit() {
var radGridTable = $find("<%=RadGrid2.ClientID%>");
if ( (radGridTable.get_masterTableView().get_dataItems().length) ==0 )
{
alert("請選擇資料項目..");
return false;
}
selectedItems = radGridTable.get_masterTableView().get_selectedItems();
if (selectedItems.length > 0) {
// find Window Manager
var manager = $find("<%=RadWindowManager1.ClientID%>");
// find Window
var window = manager.getWindowByName("RadWindow1");
// find Grid Master Table
var masterTable = $find("<%=RadGrid2.ClientID%>").get_masterTableView();
// get the selected item
var selectedItem = masterTable.get_selectedItems()[0];
// extract the PK value
var pk = masterTable.getCellByColumnUniqueName(selectedItem, "seq_no").innerHTML;
// open the link
window.setUrl("EquipForm.aspx?action=APPROVE&pk=" + pk);
window.show();
// avoid postback
return false;
}
else {
alert("請選擇資料項目..");
return false;
}
}
function rowEditSaved() {
var radGridTable = $find("<%=RadGrid3.ClientID%>");
if ((radGridTable.get_masterTableView().get_dataItems().length) == 0) {
alert("請選擇資料項目..");
return false;
}
selectedItems = radGridTable.get_masterTableView().get_selectedItems();
if (selectedItems.length > 0) {
// find Window Manager
var manager = $find("<%=RadWindowManager1.ClientID%>");
// find Window
var window = manager.getWindowByName("RadWindow2");
// find Grid Master Table
var masterTable = $find("<%=RadGrid3.ClientID%>").get_masterTableView();
// get the selected item
var selectedItem = masterTable.get_selectedItems()[0];
// extract the PK value
var pk = masterTable.getCellByColumnUniqueName(selectedItem, "seq_no").innerHTML;
// open the link
window.setUrl("EquipForm.aspx?action=SAVE&pk=" + pk);
window.show();
// avoid postback
return false;
}
else {
alert("請選擇資料項目..");
return false;
}
return false;
}
function masterClientClose(sender, eventArgs) {
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.rebind();
masterTable = $find("<%= RadGrid2.ClientID %>").get_masterTableView();
masterTable.rebind();
}
function savedMasterClientClose(sender, eventArgs) {
var masterTable = $find("<%= RadGrid3.ClientID %>").get_masterTableView();
masterTable.rebind();
}
function masterClientShow(sender, eventArgs)
{
var masterTable = $find("<%= RadGrid2.ClientID %>").get_masterTableView();
sender.argument = masterTable;
}
function masterSavedClientShow(sender, eventArgs) {
var masterTable = $find("<%= RadGrid3.ClientID %>").get_masterTableView();
sender.argument = masterTable;
}
function rowDBClick(sender, args) {
rowEdit();
}
function rowDBClickSaved(sender, args) {
return rowEditSaved();
}
</script></telerik:RadCodeBlock>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Outlook">
<Windows>
<telerik:RadWindow runat="server" Behavior="Default" ID="RadWindow1" Width="840px" Height="600px"
InitialBehavior="None" Left="" Modal="True" NavigateUrl="" OnClientShow="masterClientShow" OnClientClose="masterClientClose"
Top="" VisibleStatusbar="false" ReloadOnShow="True" ShowContentDuringLoad="False"></telerik:RadWindow>
<telerik:RadWindow runat="server" Behavior="Default" ID="RadWindow2" Width="840px" Height="600px"
InitialBehavior="None" Left="" Modal="True" NavigateUrl="" OnClientShow="masterSavedClientShow" OnClientClose="savedMasterClientClose"
Top="" VisibleStatusbar="false" ReloadOnShow="True" ShowContentDuringLoad="False"></telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
-- Callee
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;//IE (and Moz as well)
return oWindow;
}
function CloseAndExitPopWindow(message) {
GetRadWindow().Close();
if (message.length != 0)
alert(message);
var masterTable = GetRadWindow().argument;
masterTable.rebind();
}
function RefreshParentPage()
{
var masterTable = GetRadWindow().argument;
masterTable.rebind();
}
</script>
</telerik:RadCodeBlock>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Outlook" >
<Windows>
<telerik:RadWindow runat="server" Behavior="Default" ID="RadWindow1" Width="740px" Height="540px"
InitialBehavior="None" Left="" Modal="True" NavigateUrl=""
Top="" VisibleStatusbar="false" ReloadOnShow="True" ShowContentDuringLoad="False"></telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"><script type="text/javascript">
function rowEdit() {
var radGridTable = $find("<%=RadGrid2.ClientID%>");
if ( (radGridTable.get_masterTableView().get_dataItems().length) ==0 )
{
alert("請選擇資料項目..");
return false;
}
selectedItems = radGridTable.get_masterTableView().get_selectedItems();
if (selectedItems.length > 0) {
// find Window Manager
var manager = $find("<%=RadWindowManager1.ClientID%>");
// find Window
var window = manager.getWindowByName("RadWindow1");
// find Grid Master Table
var masterTable = $find("<%=RadGrid2.ClientID%>").get_masterTableView();
// get the selected item
var selectedItem = masterTable.get_selectedItems()[0];
// extract the PK value
var pk = masterTable.getCellByColumnUniqueName(selectedItem, "seq_no").innerHTML;
// open the link
window.setUrl("EquipForm.aspx?action=APPROVE&pk=" + pk);
window.show();
// avoid postback
return false;
}
else {
alert("請選擇資料項目..");
return false;
}
}
function rowEditSaved() {
var radGridTable = $find("<%=RadGrid3.ClientID%>");
if ((radGridTable.get_masterTableView().get_dataItems().length) == 0) {
alert("請選擇資料項目..");
return false;
}
selectedItems = radGridTable.get_masterTableView().get_selectedItems();
if (selectedItems.length > 0) {
// find Window Manager
var manager = $find("<%=RadWindowManager1.ClientID%>");
// find Window
var window = manager.getWindowByName("RadWindow2");
// find Grid Master Table
var masterTable = $find("<%=RadGrid3.ClientID%>").get_masterTableView();
// get the selected item
var selectedItem = masterTable.get_selectedItems()[0];
// extract the PK value
var pk = masterTable.getCellByColumnUniqueName(selectedItem, "seq_no").innerHTML;
// open the link
window.setUrl("EquipForm.aspx?action=SAVE&pk=" + pk);
window.show();
// avoid postback
return false;
}
else {
alert("請選擇資料項目..");
return false;
}
return false;
}
function masterClientClose(sender, eventArgs) {
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.rebind();
masterTable = $find("<%= RadGrid2.ClientID %>").get_masterTableView();
masterTable.rebind();
}
function savedMasterClientClose(sender, eventArgs) {
var masterTable = $find("<%= RadGrid3.ClientID %>").get_masterTableView();
masterTable.rebind();
}
function masterClientShow(sender, eventArgs)
{
var masterTable = $find("<%= RadGrid2.ClientID %>").get_masterTableView();
sender.argument = masterTable;
}
function masterSavedClientShow(sender, eventArgs) {
var masterTable = $find("<%= RadGrid3.ClientID %>").get_masterTableView();
sender.argument = masterTable;
}
function rowDBClick(sender, args) {
rowEdit();
}
function rowDBClickSaved(sender, args) {
return rowEditSaved();
}
</script></telerik:RadCodeBlock>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Outlook">
<Windows>
<telerik:RadWindow runat="server" Behavior="Default" ID="RadWindow1" Width="840px" Height="600px"
InitialBehavior="None" Left="" Modal="True" NavigateUrl="" OnClientShow="masterClientShow" OnClientClose="masterClientClose"
Top="" VisibleStatusbar="false" ReloadOnShow="True" ShowContentDuringLoad="False"></telerik:RadWindow>
<telerik:RadWindow runat="server" Behavior="Default" ID="RadWindow2" Width="840px" Height="600px"
InitialBehavior="None" Left="" Modal="True" NavigateUrl="" OnClientShow="masterSavedClientShow" OnClientClose="savedMasterClientClose"
Top="" VisibleStatusbar="false" ReloadOnShow="True" ShowContentDuringLoad="False"></telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
-- Callee
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;//IE (and Moz as well)
return oWindow;
}
function CloseAndExitPopWindow(message) {
GetRadWindow().Close();
if (message.length != 0)
alert(message);
var masterTable = GetRadWindow().argument;
masterTable.rebind();
}
function RefreshParentPage()
{
var masterTable = GetRadWindow().argument;
masterTable.rebind();
}
</script>
</telerik:RadCodeBlock>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Outlook" >
<Windows>
<telerik:RadWindow runat="server" Behavior="Default" ID="RadWindow1" Width="740px" Height="540px"
InitialBehavior="None" Left="" Modal="True" NavigateUrl=""
Top="" VisibleStatusbar="false" ReloadOnShow="True" ShowContentDuringLoad="False"></telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
沒有留言:
張貼留言