Page 1 of 1

Hide field in grid edit but keep on list

Posted: Wed Jan 18, 2023 4:25 am
by crash

I have hidden a field in grid edit and inline edit using client script, listpage, startup script $('[data-name="<fieldname>"]').hide();

This allows for the field still to be edited in the background.
I need to hide this field in the list page after edit

If I hide in gridedit/inline edit it also hide in list... i need it to show in the list.. is there a way around this ?

Thanks


Re: Hide field in grid edit but keep on list

Posted: Wed Jan 18, 2023 6:11 am
by MichaelG

Try the FieldVisibility extension (for registered users only), which allow you to hide field for grid edit but show for list.


Re: Hide field in grid edit but keep on list

Posted: Wed Jan 18, 2023 1:53 pm
by crash

It’s doing the same thing. If I hide in grid edit / inline edit it also hides on list page. I’ve used 1 and 0 and “1” and “0”.

All this is in the extention showing as Bool
What am I doing wrong.


Re: Hide field in grid edit but keep on list

Posted: Sat Jan 21, 2023 10:07 pm
by crash

Can anyone help with this problem? I'm using the field visibility extension

This the table option are set to bool... I use 1 and 0
I would expect the field to not be visible on one of those options,
I've tried same with userid and userlevel... it either hies it everywhere or shows it everywhere


Re: Hide field in grid edit but keep on list

Posted: Thu Jan 26, 2023 5:27 am
by crash

Has anyone else found this error with this extension, mine should work but no luck


Re: Hide field in grid edit but keep on list

Posted: Sun Jan 29, 2023 6:50 am
by darkdragon

I made something somehow similar to you.
I used CurrentAction to determine if the List in GridEdit mode:

	if ((CurrentPageID() == "list" && CurrentAction == "gridedit") || (CurrentPageID() == "add") || (CurrentPageID() == "edit")) {

		Field1.Visible = false;
		Field2.Visible = false;
		...
		
	}

Re: Hide field in grid edit but keep on list

Posted: Mon Jan 30, 2023 2:15 am
by crash

This is great thanks, that worked

How would I include Inline Edit ?


Re: Hide field in grid edit but keep on list

Posted: Mon Jan 30, 2023 10:24 pm
by darkdragon

For Inline Edit, you need to figure it out how to intercept creation of the DOM elements and hide them out. (you need to create a setInterval function)
I dot no use Inline Editing at all, so I have no idea of any tips & tricks.