Hide Add Button

This public forum is for user-to-user discussions of ASPMaker. Note that this is not support forum.

Hide Add Button

Postby JAW » Sat Nov 25, 2017 11:25 pm

Hello,
I would like to hide the Add button on the List page but I also have the Grid Add button and I need that one to stay. I have tried to use CSS with display: none; but that doesn't seem to work. I have tried multiple variations of the CSS code using ewAdd, ewAdd.btn-sm, and others but none of them work. I am wondering if there is a way to accomplish this.

Thanks
JW
JAW
 
Posts: 65
Joined: Tue Nov 20, 2012 8:26 pm

Re: Hide Add Button

Postby motfs » Mon Nov 27, 2017 10:54 am

Use the ListOptions_Rendered server event to hide, e.g.:

AddEditOptions.GetItem("add").Visible = False
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: Hide Add Button

Postby JAW » Sat Dec 02, 2017 3:05 am

Hello,
Thanks for the suggestion. I put it in the ListOptions_Rendered as suggested but it didn't work. The add button still shows. Anything else that I may be able to do or any reason that may not be working?

Regards,
JW
JAW
 
Posts: 65
Joined: Tue Nov 20, 2012 8:26 pm

Re: Hide Add Button

Postby ready4data » Sat Dec 02, 2017 4:29 am

Try this
Client scripts>Startup
$("a.ewAdd").hide();

Scott
ready4data
 
Posts: 276
Joined: Mon Nov 19, 2012 8:24 pm

Re: Hide Add Button

Postby motfs » Sat Dec 02, 2017 11:04 am

> Anything else that I may be able to do or any reason that may not be working?

I have tried the code and the button is hided as expected. Double check the generated files to verify if the code has been generated and write the response (Response.Write) to verify.
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: Hide Add Button

Postby JAW » Sat Dec 02, 2017 7:10 pm

Hello,
What I have discovered is the button is hidden in the bottom paging section but not the top. I resolved that by removing the top paging section. I have not yet tried ready4data's suggestion yet but I will and then post what happens.

Regards,
JW
JAW
 
Posts: 65
Joined: Tue Nov 20, 2012 8:26 pm


Return to General Discussion (ASPMaker)