[CLOSED] Migration issue Ext.Net.X.Js.Call

  1. #1

    [CLOSED] Migration issue Ext.Net.X.Js.Call

    Hoping this is a simple change of the calls. Best I can tell the call is made but nothing happens. Worked fine in 1.x and I didn't see anything about this in conversion threads.

        var CashFlowChart;
        
        var loadCashFlowChart = function() {
            debugger;
            var panel = #{CashFlowChartPanel};
            panel.body.mask("Loading", "x-mask-loading");
            var options = getCashFlowChartOptions();
            $.getJSON('CashFlowsChart.ashx', function (data) {
                $.extend(true, options, data);
                CashFlowChart = getChart(options);
                refreshCashFlowChart();
                panel.body.unmask();
            });
        };
       Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            'CType(Master, AdvisorMaster).Channel = AdvisorMaster.Channels.Home
            If Not IsPostBack And Not Ext.Net.X.IsAjaxRequest Then
                If Request.QueryString("c") IsNot Nothing AndAlso Request.QueryString("t") IsNot Nothing Then
                    PageContext = New PageContext(Request.GetDecrypted(Of Integer)("t"), Request.GetDecrypted(Of Integer)("c"))
                Else
                    PageContext = GetHighestContext()
                End If
                DataBind()
    
                Ext.Net.X.Js.Call("loadCashFlowChart")
            End If
        End Sub
    Last edited by Daniil; Jul 16, 2013 at 4:17 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Couldn't reproduce with the following sample:

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                X.Js.Call("myFunction");
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <script>
            var myFunction = function()
            {
                alert('Test!');
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    </body>
    </html>
  3. #3
    Would it make any difference being called from a direct event?
                   <ext:Panel ID="AllocationPiePanel" runat="server" IconCls="icon-piechart" Border="false" Title="Allocation">
                        <Content>
                            <uc:AllocationPieChart ID="AllocationPieChart" runat="server" />
                        </Content>
                        <DirectEvents>
                            <Activate OnEvent="ActivateAllocationPiePanel" 
                                        Before="return !this.lockDirectEvent;"
                                        Complete="this.lockDirectEvent = true;" />
                        </DirectEvents>
                    </ext:Panel>
        Protected Sub ActivateAllocationPiePanel(sender As Object, e As DirectEventArgs)
            Ext.Net.X.Js.Call("initAllocationPieChart")
        End Sub
  4. #4
    I have checked this
    Ext.Net.X.Js.Call("initAllocationPieChart")
    produces
    initAllocationPieChart();
    during a DirectEvent as it should.

    Is there no any JavaScript error on that call?

    Could you provide a full test case?

Similar Threads

  1. Migration from ext 1.0 to 2.0
    By speedstepmem4 in forum 1.x Help
    Replies: 1
    Last Post: Jun 11, 2013, 9:14 AM
  2. Replies: 1
    Last Post: Jun 05, 2013, 11:01 AM
  3. [CLOSED] ClientID Issue (get selected value and call a Webservice)
    By John_Writers in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 12, 2013, 11:52 AM
  4. [CLOSED] Migration from 1.5 to 2
    By IanPearce in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 29, 2012, 12:40 PM
  5. Replies: 2
    Last Post: Feb 21, 2011, 5:22 AM

Posting Permissions