Aug 16, 2012, 11:24 AM
[CLOSED] Disable some Controls before DirectMethod
Hello,
Is there any way to disable a control (Panel, GridPanel, Window etc) just before firing direct-method?
I'm trying to achieve in my sample code:
- When the button is clicked, the panel should be disabled immediatelly (page should be updated)
- Now the button1_click (direct-method) fires and takes some time to finish
- After that, the panel gets enabled
Ext.Net 1.5.0
Framework 4
IE 8
P.
Is there any way to disable a control (Panel, GridPanel, Window etc) just before firing direct-method?
I'm trying to achieve in my sample code:
- When the button is clicked, the panel should be disabled immediatelly (page should be updated)
- Now the button1_click (direct-method) fires and takes some time to finish
- After that, the panel gets enabled
Ext.Net 1.5.0
Framework 4
IE 8
P.
using System;
using System.Collections.Generic;
using System.Web;
using Ext.Net;
public partial class test5 : System.Web.UI.Page
{
Panel panel1;
[DirectMethod]
public void button1_click()
{
// takes some time to load...
panel1.Html = "Panel is now loaded.";
}
protected void Page_Load(object sender, EventArgs e)
{
ResourceManager res_man = new ResourceManager();
res_man.ID = "res_man";
this.Controls.Add(res_man);
panel1 = new Panel();
panel1.ID = "panel1";
panel1.Height = 200;
panel1.Width = 200;
Ext.Net.Button button1 = new Ext.Net.Button();
button1.ID = "button1";
button1.Text = "Load panel";
button1.Listeners.Click.Handler = "#{panel1}.setDisabled(true);";
button1.Listeners.Click.Handler += "#{DirectMethods}.button1_click();";
button1.Listeners.Click.Handler += "#{panel1}.setDisabled(false);";
this.Form.Controls.Add(panel1);
this.Form.Controls.Add(button1);
}
}
Last edited by Daniil; Aug 18, 2012 at 9:39 AM.
Reason: [CLOSED]