Disable client javascript on click

Posted by: linkservice on 10 September 2017, 11:32 am EST

  • Posted 10 September 2017, 11:32 am EST

    <p>Is there a way to disable client javascript on click on every cell of the grid?</p>
    <p>I'm asking that because if i put a templatefield with a checkbox in a big grid every time i try to click on the checkbox it is VERY slow...</p>
    <p> </p>
  • Replied 10 September 2017, 11:32 am EST

    <p>You could stop the event propagation from the checkbox click event handler.</p>
    <p>First add the following function to the page.</p>
    <p> </p>
    <p>  function stopPropagatingEvent(event) {<br />            // if stopPropagation exists run it on the original event<br />            if (event.stopPropagation)<br />                event.stopPropagation();<br />            // otherwise set the cancelBubble property of the original event to true (IE)<br />            event.cancelBubble = true;<br />        }</p>
    <p>Then call this method from the click event handler.</p>
    <p> </p>
    <p>            <C1GridView:C1TemplateField><br />                <ItemTemplate><br />                    <input onclick="stopPropagatingEvent(event)" type="checkbox" /> <label>Test</label><br />                </ItemTemplate><br />            </C1GridView:C1TemplateField><br /></p>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels