bernhard Posted April 16, 2015 Share Posted April 16, 2015 when a PageListSelect is populated it looks like this: if you want to clear the value of this field rather than changing the referenced page, you have to do lots of clicking if your selected page is somewhere down the tree: it would be great to have a "clear" button right beside the "change" button 7 Link to comment Share on other sites More sharing options...
felix Posted April 16, 2015 Share Posted April 16, 2015 Count me in! 1 Link to comment Share on other sites More sharing options...
Soma Posted April 16, 2015 Share Posted April 16, 2015 I remember this a discussion years ago. It's intentional as explained by Ryan for his client project needs - to avoid removing of selected by accident if I remember correctly. Link to comment Share on other sites More sharing options...
bernhard Posted April 16, 2015 Author Share Posted April 16, 2015 i really respect this approach but i think the possibility should at least be there after clicking on "change" so it would appear beside "cancel" or like the new pageDelete floating right. for my project this behaviour is a nightmare... unfortunately i'm not skilled enough to make this on my own, but i thought maybe this would be a 5-min-thing for ryan or any of the other gurus Link to comment Share on other sites More sharing options...
Can Posted May 31, 2015 Share Posted May 31, 2015 Maybe it could be by choice in the field settings? 2 Link to comment Share on other sites More sharing options...
bernhard Posted November 25, 2015 Author Share Posted November 25, 2015 /site/ready.php $wire->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event){ $process = $event->object; $page = $process->getPage(); $config = wire('config'); if($page->template == 'basic-page') { $config->scripts->append($config->urls->templates . 'scripts/pagefieldclearbutton.js'); } }); /site/scripts/pagefieldclearbutton.js $(window).load(function() { $('ul.PageListActions').append('<li class="PageListActionSelect PageFieldClearButton"><a href="#">Unselect</a></li>'); $('.PageFieldClearButton').click(function() { $(this).parent().siblings('p.PageListSelectName').html(''); $('#Inputfield_pageselect').val(''); }); }); working starting point. maybe someone wants to take this further... as you can see it jumps to the pagetop for now 2 Link to comment Share on other sites More sharing options...
bernhard Posted January 1, 2016 Author Share Posted January 1, 2016 i put together a small module for this: https://processwire.com/talk/topic/11805-pagelistselectunselectbutton/ 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now