Paging: get total number of pages

i am sorry if my question is stupid but looking in this page i cant find how to get the total numbers o pages.

I have to write in the tool bar 1 of [TOTAL pages]

Thank you.

You may try to use the following code:

var total=mygrid.getRowsNum(); var pageSize=mygrid.rowsBufferOutSize var pageNum=total/pageSize

Thank you.