Mar 08, 2012, 9:45 AM
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.
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?
i followed this thread..but no use...
http://forums.ext.net/showthread.php...ommand-Buttons
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?
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.