Error on client-side event when registering it on server-side

3 posts, 0 answers
  1. Tulika
    Tulika avatar
    15 posts
    Member since:
    Aug 2007

    Posted 29 Jun 2009 Link to this post

    Hi,

    I'm creating dynamic docks and zones as well. While creating docks I register 2 client-side events on server side -- OnClientDockPositionChanging and OnClientDragStart. OnClientDockPositionChanging works fine but when OnClientDragStart throws javascript error.

    function OnClientDockPositionChanging(sender, eventArgs) 
       alert("Stop"); 
       eventArgs.set_cancel(true); 
    function OnClientDragStart(sender, eventArgs) 
       alert("Stop Drag"); 
       eventArgs.set_cancel(true); 
     

      
    private RadDock CreateRadDockFromState(DockState state, int number) 
        { 
            RadDock dock = new RadDock(); 
            dock.ID = string.Format("RadDock{0}", number); 
            dock.ApplyState(state); 
            dock.Visible = !state.Closed; 
            dock.Commands.Add(new DockPinUnpinCommand()); 
            dock.OnClientDockPositionChanging = "OnClientDockPositionChanging"
            dock.OnClientDragStart = "OnClientDragStart"
            return dock; 
        } 
        private RadDock CreateRadDock(int id) 
        { 
            RadDock dock = new RadDock(); 
            dock.ID = string.Format("RadDock{0}", id); 
            dock.Title = txtTitle.Text; 
            dock.Text = txtText.Text + "<br>" + dock.ID; 
            dock.UniqueName = Guid.NewGuid().ToString(); 
            dock.Width = Unit.Pixel(300); 
            dock.Commands.Add(new DockPinUnpinCommand()); 
            dock.OnClientDockPositionChanging = "OnClientDockPositionChanging"
            dock.OnClientDragStart = "OnClientDragStart"
            return dock; 
        } 
  2. Tulika
    Tulika avatar
    15 posts
    Member since:
    Aug 2007

    Posted 01 Jul 2009 Link to this post

    Hi,

    Is there any comment on this? Its urgent. Any favor is  appreciated.

    Thanks,
    Tulika
  3. Obi-Wan Kenobi
    Obi-Wan Kenobi  avatar
    460 posts
    Member since:
    Aug 2007

    Posted 01 Jul 2009 Link to this post

     

    function OnClientDragStart(sender, eventArgs) {

     

    alert(

    "Stop Drag");

     

    eventArgs.set_cancel(

    true); ----eventArgs do NOT have set_cancel method. This means that OnClientDragStart event can't be canceled.

     

    }
    P.S. OnClientDockPositionChanging event

    can be canceled(it has set_cancel method)

Back to Top