|
Title: How do i capture click event for cell in easyui-propertygrid? Post by: codeguyross 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. Title: Re: How do i capture click event for cell in easyui-propertygrid? Post by: codeguyross 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 ); } }); |