[CLOSED] App.direct is not a function ?

  1. #1

    [CLOSED] App.direct is not a function ?

    Hi, need some help..
    I'm using MVC Ext.Net latest version

    So i did this on my controller

    [DirectMethod]
            public void DeleteSelectedCampaignBaseBatch(string campaignbasebatch)
            {
                X.Msg.Alert("", campaignbasebatch).Show();
               
            }
    and created JavaScript function on my view as following

    <script>
           function onDeleteButtonClick() {
    
               var CampaignBaseBatch = App.CustomerApprovalGridPanel.getSelectionModel().getSelection()[0].get('CampaignBaseBatch');
    
               App.direct.DeleteSelectedCampaignBaseBatch(CampaignBaseBatch, {
                   success: function (result) {
                       alert("Success");
    
                   },
                   failure: function (result) {
                       alert("Failure");
                   }
    
               });
    
           }
        </script>
    and put the function as my handler on a button at GridPanel like this..

    Html.X().Button()                                
                .Text("Delete")
                .Icon(Icon.Exclamation)
            .Handler("onDeleteButtonClick()")
    but i keep getting error.. App.direct.DeleteSelectedCampaignBaseBatch is not a function..

    What am i missing ?

    Thanks before
    Last edited by Daniil; May 02, 2014 at 7:13 PM. Reason: [CLOSED]
  2. #2
    Hi

    Did you mark controller by DirectController attribute?
    See controller code in online sample
    http://mvc.ext.net/#/Events/DirectMethod/
  3. #3
    Ah.. that must be it..

    Thank you very much

    Please mark this thread as closed

Similar Threads

  1. Replies: 2
    Last Post: May 13, 2014, 8:52 AM
  2. [CLOSED] Output Cache issue with Direct Method / Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 01, 2013, 5:03 AM
  3. Direct method and direct event over SSL?
    By dimitar in forum 1.x Help
    Replies: 0
    Last Post: Oct 08, 2011, 8:09 PM
  4. Success function in calling Direct Method..help!
    By Aleksa007 in forum 1.x Help
    Replies: 2
    Last Post: Jul 26, 2011, 4:36 PM
  5. Replies: 3
    Last Post: Apr 20, 2010, 12:21 PM

Tags for this Thread

Posting Permissions