[CLOSED] How to add a Click Event on the TrayClock

  1. #1

    [CLOSED] How to add a Click Event on the TrayClock

    Is there any way to add an OnClick DirectEvent on the TrayClock using Ext.NET MVC? And How to customize the TrayClock on the Desktop?

    Thanks
    Last edited by Daniil; Sep 03, 2013 at 4:59 AM. Reason: [CLOSED]
  2. #2
    Hi @Ujvari,

    Here is an example of both the requirements.

    View
    @{
        var X = Html.X(); 
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>  
        
        <style>
            .my-tray-clock {
                color: red;
            }
        </style>
    
        <script>
            var onAfterRender = function (taskbar) {
                var tc = taskbar.tray.child("trayclock");
    
                tc.mon(tc.getEl(), "click", function() {
                    App.direct.TrayClockClick(this.getText());
                }, tc);
            };
        </script>
    </head>
    <body>
        @X.ResourceManager()
    
        @(X.Desktop()
            .TaskBar(X.DesktopTaskBar()
                .TrayClock(tc => tc.Cls = "my-tray-clock")
                .Listeners(events =>
                    events.AfterRender.Fn = "onAfterRender"
                )
            )
        )
    
    </body>
    </html>
    Controller
    [DirectController]
    public class RazorController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        [DirectMethod]
        public ActionResult TrayClockClick(string text)
        {
            X.Msg.Alert("TrayClockClick", text).Show();
    
            return this.Direct();
        }
    }

Similar Threads

  1. Replies: 5
    Last Post: Jul 18, 2013, 3:08 PM
  2. [CLOSED] Click event on DIV HTML
    By John_Writers in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 23, 2013, 3:32 PM
  3. Treepanel click event
    By Mr.Techno in forum 1.x Help
    Replies: 0
    Last Post: Sep 21, 2011, 5:28 AM
  4. Panel Click Event
    By Tror in forum 1.x Help
    Replies: 0
    Last Post: Jun 08, 2010, 6:13 AM
  5. Change Event then Click event : issue
    By jeybonnet in forum 1.x Help
    Replies: 2
    Last Post: May 28, 2010, 1:19 PM

Tags for this Thread

Posting Permissions