this is my way for embed js code block in view file:
solution here If we are using default pagination option like