PDA

View Full Version : [CLOSED] EventMask add from code behind (with customtarget option) and handle when it should disapear



ViDom
May 14, 2013, 11:00 AM
Hi,
Like in title. I've found answer on second part(handle when disapear) of question here: post (http://forums.ext.net/showthread.php?13278-Load-mask-from-code-behind&p=54816&viewfull=1#post54816)

I have write this code but there is no setter in EventMask of DirectEvents:


DirectEvents.Click.EventMask = new EventMask
{
Target = MaskTarget.CustomTarget,
Msg = "Please wait...",
CustomTarget = "#{FormPanel}",
ShowMask = true
};


How should it be done? with DirectEvents.Click.Before

Thanks,
ViDom

Daniil
May 14, 2013, 1:06 PM
Hi @ViDom,

I think it should be done like this.

DirectEvents.Click.EventMask.Target = MaskTarget.CustomTarget;

ViDom
May 14, 2013, 6:38 PM
Hi @ViDom,

I think it should be done like this.

DirectEvents.Click.EventMask.Target = MaskTarget.CustomTarget;



Yeah you are right. But how should I add CustomTarget with #{control.ID} or something like that? or just apply control.ClientID to CustomTarget property of EventMask?

Baidaly
May 15, 2013, 12:20 AM
Yeah you are right. But how should I add CustomTarget with #{control.ID} or something like that? or just apply control.ClientID to CustomTarget property of EventMask?

Yes, you are right. You should use CustomTarget property:



@(Html.X().Button()
.Text("Click Me, now!")
.ID("MyButton")
.DirectEvents(de => {
de.Click.Url = Url.Action("UpdateTimeStamp");
de.Click.EventMask.CustomTarget = "#{MyButton}";
de.Click.EventMask.Target = MaskTarget.CustomTarget;
de.Click.EventMask.Msg = "My mask!";
de.Click.EventMask.ShowMask = true;
})
)

Daniil
May 15, 2013, 5:22 AM
This should do the job as well. In the context of WebForms.

de.Click.EventMask.CustomTarget = MyButton.ClientID;