Page 1 of 1

number of rows in a grid

Posted: Wed Jan 22, 2014 6:14 pm
by sgagn0
I would like to show the right number of rows in a grid (remove blank rows)
Ex: I have the 24 rows per page, but only 10 to show as per entered search criterias

I found 2 ways of doing it, but do not like them as much and I am wondering if there is another way I could do this.
1) add a NbOfRecords field in the header and set number number of rows in javascript on the page onload
2) add a recexist field in the grid and loop through all grid records until recexist is not true (again on the page onload event)

Is there another way I could do this?

Thanks,

Re: number of rows in a grid

Posted: Thu Jan 23, 2014 11:34 am
by David
Using the JavaScript API is the only way that exists to change the number of grid rows.

I think your technique #1 is the simplest way there is. You could perhaps streamline this a bit by using a hidden field with a standard id and a reusable JS function to look for it (quit if not present) and make the adjustment. The grid id could be passed into the function.

Another interesting idea is that you could use a global event (firing on each screen render) to look for any grids (along with standard hidden field), and adjust if necessary:

http://www.profoundlogic.com/docs/displ ... pui.onload

With this option and a clever script, all you'd have to do is remember to put the standard hidden field on screen, you wouldn't have to code an 'onload' event for each screen.

Hope this helps, or gives some ideas.