How to add a custom javascript event on load phpgrid (for example add keyup in document ready)

QuestionsHow to add a custom javascript event on load phpgrid (for example add keyup in document ready)
Jorge asked 5 years ago

Hi Abu,

I'm using the phpgrid licenced vesion , and we need to define events (like keyup or keypress) for certain fields in the add and edit form, but to get it working we need to define the events in jquery document ready:

<script>
Jquery(document).ready(function(){
jQuery("input[name=suma].editable").keyup(function() {sumtotal();})
});
</script>

and it is not working (perhaps because it is already defined to show the grid). At this moment we are defining the javascript function on edit options ($col["editoptions"] = array(“onchange”=>”sumtotal();”) ), but it only works when you leave the field.

Thanks in advance.

Jorge

2 Answers
Abu Ghufran answered 5 years ago

You can replace onchange to onkeyup.

$col["editoptions"] = array(“onkeyup”=>”sumtotal();”)

Jorge answered 5 years ago

Thanks!

Your Answer

9 + 16 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!