EasyUI Forum
May 04, 2024, 07:24:41 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How do i capture click event for cell in easyui-propertygrid?  (Read 12552 times)
codeguyross
Newbie
*
Posts: 15


View Profile Email
« on: November 21, 2013, 09:45:56 AM »

Hello,

How do I capture the click event when clicking a cell in the easyui-propertygrid? Here are some of the things i have tried:

    $( '#myPropertyGrid').propertygrid().click(function( event ) {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });
    $(document).click(function() {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });
    $( "body" ).click(function( event ) {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });

    $( "myPropertyGrid" ).click(function( event ) {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });

    $( "*" ).click(function( event ) {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });

    $( "propertiesPanel" ).click(function( event ) {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });

    $( "#propertiesPanel" ).click(function( event ) {
        $( "#log" ).html( "clicked: " + event.target.nodeName );
    });
//////////////////////////////////////////////////////////////////////////// 
  function clickHandler(e){

        var elem, evt = e ? e:event;
        if (evt.srcElement)  elem = evt.srcElement;
        else if (evt.target) elem = evt.target;

        alert (''
            +'You clicked the following HTML element: \n <'
            +elem.tagName.toUpperCase()
            +'>'
        )
        return true;
    }
   

   document.onclick=clickHandler;

This is related to another question i have about opening a dialog window when clicking a cell in the easyui-propertygrid. I am pretty sure i can use javascript to open the dialog but I would need to know how to capture the click event first.
Logged
codeguyross
Newbie
*
Posts: 15


View Profile Email
« Reply #1 on: November 21, 2013, 10:22:16 AM »

If anyone needs to know how to do this I have found a solution. You can capture the click event for a cell in a property grid with the following code.

 $('#myPropertyGrid').propertygrid({

        onSelect: function (rowIndex, rowData)
        {

            alert (''
                +'You clicked the following HTML element: \n'
                +rowData.name
            );
        }
    });
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!