number of rows in a grid

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
sgagn0
Profound User
Posts: 41
Joined: Fri Aug 16, 2013 7:23 am
First Name: Sebastien
Last Name: Gagne
Company Name: Oceanex
Contact:

number of rows in a grid

Post 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,
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: number of rows in a grid

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests