Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to restrict adding a new row upon Enter

SA-8379

Summary



How to avoid adding new row to a repeating grid when you press the Enter key.

Resolution



This issue is resolved through the following Local-change:

Include the below code in a non-auto generated section and include this section below the grid in the main section.


<script>

var orig;
if(!orig){
 orig = pega.ui.grid.prototype.gridEventHandler;
}

pega.ui.grid.prototype.gridEventHandler = function(e,container)
{

var eventType = e.type;
var Event = pega.util.Event;
var target  = Event.getTarget(e);
var eventKeyCode = e.keyCode;

if(eventKeyCode==13)
{
 if(target && (target.type=="CHECKBOX" || target.type=="radio" || target.tagName=="SELECT"))
        Event.stopPropagation(e);
else
        Event.stopEvent(e);

}


if(eventKeyCode!=13)
{

orig.call(this,e,container);
}


};
</script>

 

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us