Adding custom event in jQGrid pager input box

/*

We can add Custom event such as blur, click, etc in input box of pager in JqGrid
Just Create a new Jquery Event Object, assign its keyCode property with 13–> (code for “Enter Key” in this case )
Now trigger the predefined event you want with your custom event ( in this case I wanted to trigger the “Enter Key Press” event with blur event

*/

var keyPressEvent=jQuery.Event('keypress');
keyPressEvent.which=13;
keyPressEvent.keyCode=13;
$('input.ui-pg-input').blur(function(){
$(this).trigger(keyPressEvent)
});

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s