netcarver Posted October 8, 2014 Share Posted October 8, 2014 Hey everyone, I'd like to be able to mod InputfieldAsmSelect a little with what seems like a simple mod but I've been hitting a wall with it. What I want to do is simply stop the pre-selected options from appearing at the bottom of the Asm select dropdown and instead have them appear in their natural place in the list. So, instead of this (with selected moved out-of-order to the end)... ... I want this (with selected items in their original position)... I know that when I select or deselect an option - without saving the form - the item stays in its initial, correct, position. But once I save the form, all the selected items seem to be sorted to the foot of the select dropdown - so I assume that this is something to do either with the initialisation of the field in its js file or perhaps with the code thats generating the initial data to fill the list... but I can't seem to work out where this happens. Can anyone provide me with a clue? Link to comment Share on other sites More sharing options...
netcarver Posted October 9, 2014 Author Share Posted October 9, 2014 After a nights sleep I've figured it out. It was indeed the rendering of the options in the underlying select that was the issue. Commenting out lines 57-64 of InputfieldAsmSelect ___render() fixes it for me. I'll now hook that method to provide my own implementation that doesn't put all the selected options at the end. Hope that helps and thanks for looking 2 Link to comment Share on other sites More sharing options...
kongondo Posted February 24, 2015 Share Posted February 24, 2015 (edited) Hi Steve, Would you be able to share some code how you went about this? Thanks. I am trying to add extra html inputs to the <span></span> that wrap selected asmSelect values. However, not sure this would work in an asmSelect that is called as an input in a Process Module? Have never really understood Hooks comprehensively... Edit Or maybe I should just extend the InputfieldAsmSelectmodule and use my modified jquery.asmselect.js...Any other ideas welcome, thanks.. Edit 2: No, I think hooking into the Class is better/cleaner in this instance.. Edited February 24, 2015 by kongondo 1 Link to comment Share on other sites More sharing options...
netcarver Posted February 25, 2015 Author Share Posted February 25, 2015 Kongondo, I have replied to your PM about this. 1 Link to comment Share on other sites More sharing options...
jploch Posted June 19, 2019 Share Posted June 19, 2019 Hey folks! For a project I am working on, I use the nice Image Marker Module. This Module uses AsmSelect, to add the markers. Each marker is a page. Now I need the AsmSelect to use the same order as the page tree. In the dropdown list the order is fine, but when I add a new page/marker it gets added at the bottom. Iam not experienced with hooks and I could not find the line in the AsmSelect Module netcarver described. Can someone point me in the right direction? 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