Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Enhancement request: set column title #5

Closed
FleetPhil opened this issue May 9, 2017 · 6 comments
Closed

Enhancement request: set column title #5

FleetPhil opened this issue May 9, 2017 · 6 comments

Comments

@FleetPhil
Copy link

Hi - I have a use case where the drop down is a list of filter criteria for a list - each row can be selected or deselected by clicking on it and it has a tick or cross to indicate if it is selected (example below). I can update the row text dynamically and this works OK, but the column title is automatically set to the last selected item when I would like to be able to set it manually - with something like a function of JNDropDownMenu:
func setTitle(_ title : String, forColumn: NSInteger)
If not called it would default to the existing behaviour, but if present would set the column title to the specified value irrespective of the last item selected.

Let me know what you think - Thanks, Phil

screen shot 2017-05-09 at 22 37 57

@javalnanda
Copy link
Owner

@hotairforacoolbreeze Check out v 0.1.5. Updated as per your request :)
Screenshot looks nice. Are you using unicode for tick mark and cross symbol?

@FleetPhil
Copy link
Author

Thanks for the super quick response! Yes, these are Unicode 2713 and 2717 for the marks. Thanks Phil

@javalnanda
Copy link
Owner

You are welcome. Hope you are finding it useful for your project :)

@FleetPhil
Copy link
Author

Sorry - it's not working - the column title is set when the menu is first set up but then back to the previous behaviour when a menu item is selected. I think the issue is in the line of code below where the title is reset after a selection is made...
`
func confiMenuWith(row: NSInteger) {

    let title = self.titles[self.currentSelectedMenuIndex]

    if updateColumnTitleOnSelection {
        title.string = self.datasource?.titleForRow(at: JNIndexPath(column: self.currentSelectedMenuIndex, row: row), for: self)
    }

`

@javalnanda
Copy link
Owner

javalnanda commented May 10, 2017

Are you setting this flag to false ?
menu.updateColumnTitleOnSelection = false
I have mentioned that in Readme in change log.

@FleetPhil
Copy link
Author

Doh! Sorry I missed that - it's fine now, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants