Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
Question on ClientEvents - MouseUp vs client events
posted

Hi, I am currently using WebDataGrid v10.3.2120 build.

I have to perform some special sorting for my grid which I am now doing in the Grid Clientside MouseUp event for the column header by posting the grid back to server and perform the sorting in the code-behind.

When implementing the MouseUp event, I realized that out-of-box ColumnFixing on the grid no longer works as the postback happens via the MouseUp event before the ColumFixing event can even fire.

My MouseUp code looks as below...
function GridMouseUp(sender, eventArgs)
{
   var item = eventArgs.get_item();
   var type = eventArgs.get_type();

   if (item != null && eventArgs.get_type() == "header") {
            __doPostBack("Sort", item.get_column().get_key());
     }
}

I can attach another condition to the "If" criteria to skip the postback during the MouseUp if I can figure out the click was originated from the FixButton. But when I look at the sender parameter, it shows the event was originated from the WebDataGrid and does not give any specific component details e.g. the FixButton id etc.

Can someone help me identify how to intercept this FixButton click and isolate it from the MouseUp event? Thanks

Parents
  • 33839
    Verified Answer
    posted

    Hi a105019,

    Off of the event args, you can get the actual browser event that happened for the mouse up.  There it will have the target.  If the target is the image for the fix button, you'll want to do nothing.  Use the following code:

    var browsEvent = eventArgs.get_browserEvent();

                var target = browsEvent ? browsEvent.target : null;

                var isFixBtn = target && target.getAttribute && target.getAttribute('mkr') == "fixBtn";

    regards,
    David Young 

Reply Children
No Data