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 10 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 10 years ago

You can replace onchange to onkeyup.

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

Jorge answered 10 years ago

Thanks!

Your Answer

9 + 7 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?