PDA

View Full Version : [CLOSED] How to send parameters to listener with options



dataworks
Jun 05, 2014, 8:37 PM
Ive been searching for a while but haven't had luck. I want to send a parameter to the DirectMethod defined on the listener. Thanks


Ext.Net.MenuItem mni = new Ext.Net.MenuItem();
mni.ID="mniRev"+row["EXPEDIENTE_RENEWAL_FORM"].ToString();
mni.Text="Revisi?n: "+row["EXPEDIENTE_RENEWAL_FORM"].ToString();
mni.AddListener("click", "function() { App.direct.Click_Event({isUpload: true, formId: 'form1'}); }");
mni.Render(mnuPrint, RenderMode.AddTo, true);



[DirectMethod]
public void Click_Event(string revID)
{
OpenPrint(revID);
}

dataworks
Jun 05, 2014, 8:56 PM
Nevermind, solved it like this


Ext.Net.MenuItem mni = new Ext.Net.MenuItem();
mni.ID="mni"+row["EXPEDIENTE_RENEWAL_FORM"].ToString();
mni.Text="Revisi?n: "+row["EXPEDIENTE_RENEWAL_FORM"].ToString();
mni.AddListener("click", "function(e, t, o) { App.direct.Click_Event(o.revID, {isUpload: true, formId: 'form1'}); }, null, {revID: '"+mni.ID+"'}");
mni.Render(mnuPrint, RenderMode.AddTo, true);