This topic is locked

Hide Inline add button

12/20/2010 11:38:38 PM
PHPRunner General questions
D
Dale author

I have an edit page with an list showing on the edit page.

I would like to HIDE the inline add button after 4 records have been added via inline add to the record.
I can get it to hide on initial load. But if I delete one item from the list, I would like the Inline Add button to appear.

If then I add a record, to total of four records, then I want the inline button to dissappear.
Any suggestions or posts that may help would be great.

I constantly use the search in this forum and without getting anybodies goat, it really sucks.

I thought I had seen a post about this, but alas I coulnt find it.

Sergey Kornilov admin 12/21/2010

The most important part is to control number of added records on the server. There are always scenarios where client-side solution won't work i.e. user opens five inline adds first and then starts actually inputting data. Another case - user opens two browser windows and adds three records in each window.
To implement this kind of functionality you need to replace 'Inline Add' button with your own one (use 'Insert button' function).
In 'OnServer' event you need to count how many records were added already and use 'ClientAfter' event to either disable/hide 'Inline add' button (displaying corresponding message) or add a new 'inline add' line to the grid.
How to simulate 'Inline add' click:

http://xlinesoft.com/phprunner/docs/how_to_control_inline_add_edit_functionality_from_script.htm
PS. I know that forum search sucks. We'll try to switch it to Google-based search.

D
Dale author 12/21/2010

I hear you. Sometimes things that you hope would be just easy, isnt.

I will have to rethink this obviously.
If I could just count the clicks on the addnew button,

So in theory you could only open 2 more add new rows if there were already 2 records.

Maybe what I could do is make the addnew button open a popup, instead of using the inline add, then I could use the regular add record page, thus having control of how many records.
Thanks for the info.

Have a great Holiday.