RowExpander with command column not calling direct method.

  1. #1

    RowExpander with command column not calling direct method.

    Hi
    I am using a gridpanel in a window with rowexpander plugin.
    My expanding row, sub gridpanel has the command column. When the user clicks on the command column, i am trying to call a directmethod. but i am getting a error like 'directmethodname+ not a function'..

    I implemented this in my master page.

    please find the below code where i am calling directmethod.
    protected void BeforeExpand(object sender, DirectEventArgs e)
        {
            string id = e.ExtraParams["id"];
    
            Store store = new Store { ID = "StoreRow_" + id };
    
            JsonReader reader = new JsonReader();
            reader.IDProperty = "ProjectId";
            reader.Fields.Add("ProgramId", "ProjectId", "ProjectName");
            store.Reader.Add(reader);
    
            DataTable dt = prjManager.GetProjectsData();
    
            store.DataSource = dt;
            store.DataBind();
    
            this.RemoveFromCache(store.ID);
            store.Render();
            this.AddToCache(store.ID);
    
            GridPanel grid = new GridPanel
            {
                ID = "GridPanelRow_" + id,
                StoreID = "{raw}StoreRow_" + id,
                Height = 200,
                LoadMask = { ShowMask=true,Msg="Loading..."}
            };
    
            grid.ColumnModel.Columns.Add(new Column
            {
                Header = "Name",
                DataIndex = "ProjectName",
                Width = 300
            });
    
           
            var commandColumn = new Ext.Net.CommandColumn
            {
                Width = 200,
            };
    
            var gridCommand = new Ext.Net.GridCommand
            {
                CommandName = "someName",
                Icon = Icon.ChartPie,
                Text = "some Text"
            };
    
            commandColumn.Commands.Add(gridCommand);
            grid.ColumnModel.Columns.Add(commandColumn);
    
            grid.Listeners.Command.Handler = "CompanyX.GridPanel1Click()";
    
            grid.ColumnModel.ID = "GridPanelRowCM_" + id;
            
            //grid.BottomBar.Add(new PagingToolbar { ID="paging"+id,PageSize=10,HideRefresh=true});
            grid.View.Add(new Ext.Net.GridView { ID = "GridPanelRowView_" + id, ForceFit = false });
    
            //important
            X.Get("row-" + id).SwallowEvent(new string[] { "click", "mousedown", "mouseup", "dblclick" }, true);
    
            this.RemoveFromCache(grid.ID);
            grid.Render("row-" + id, RenderMode.RenderTo);
            this.AddToCache(grid.ID);
    
        }
    
        [DirectMethod(Namespace="CompanyX")]
        public void GridPanel1Click()
        {
            X.Msg.Notify("test", "clicked").Show();
        }
    This is the part of the code where you can observe i am trying to call directmethod when user clicks on commnad column.

    I also want to send entire row values to directmethod including command name.

    Please help me... why my direct method is not calling...why its throwing error?

    Click image for larger version. 

Name:	Capture.JPG 
Views:	157 
Size:	67.1 KB 
ID:	3919

    i followed this thread..but no use...
    http://forums.ext.net/showthread.php...ommand-Buttons
    Last edited by Mr.Techno; Mar 09, 2012 at 7:32 AM.

Similar Threads

  1. [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
  2. Replies: 2
    Last Post: Oct 12, 2011, 7:49 AM
  3. Success function in calling Direct Method..help!
    By Aleksa007 in forum 1.x Help
    Replies: 2
    Last Post: Jul 26, 2011, 4:36 PM
  4. Replies: 2
    Last Post: Apr 27, 2011, 2:58 PM
  5. Replies: 1
    Last Post: Mar 11, 2011, 2:54 PM

Tags for this Thread

Posting Permissions