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
45
AddNewRowSelectorImage Image Clicked Event?
posted

Is there any way of handling the Add New Row Selector Image click event?  I can't seem to find one. My users keep wanting to click it with the mouse, and they expect something to happen. It would be great if I could handle the image click event with Javascript and activate the first cell in the Add New Row.

Parents
  • 15979
    posted

    Hello chhiii,

    There is no build in functionality for handling the required by you event.

    The image that is displayed in the add new row part of the grid is actually visible only if row selectors are enabled.

    However the image actually is rendered in one <div> element and you can use this element to handle the click event with a jQuery function:

    // subscribe for jQuery methods

    <script src="http://code.jquery.com/jquery-1.5.js"></script>

     

    // create function that will simulate click on the div element

    function GetDivElement() {

     

                $('div[class|="igg_AddNewRowSelectorImageCssClass"]').click('', processEventInfo);

     

            }

     

    // handle the click event and simulate click on the add row first element

    function processEventInfo(eventElement) {

     

                var grid = $find('WebDataGrid1');

     

                var element = grid.get_behaviors().get_editingCore()._behaviors._rowAdding._row.get_cell(0).get_element().click();

     

            }

     

    // start the event when user click on the page body

    <body onmousedown="GetDivElement()">

     

    This code can help you to achieve the required by you behavior.

    Let me know if you have further questions.

Reply Children
No Data