Author Topic: Set filter from custom widget  (Read 2243 times)

trasdahl

  • Jr. Member
  • **
  • Posts: 28
    • View Profile
Set filter from custom widget
« on: March 21, 2011, 20:45:40 »
Is there a command that would allow me to set a filter from any layout item through a click1-action? I would like to be able to write something like

"Artist(click1=SelectArtist(%a))"

or

"Album(click1=SetFilter(artist,%a))"

or maybe something with a generic Button. Is it possible? Maybe through a "RunPerlCode"-command?


Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1082
    • View Profile
Re: Set filter from custom widget
« Reply #1 on: March 30, 2011, 04:07:12 »
Sorry to reply so late.
There is no command to do that yet, though it is planned.
It is, of course, possible to do with the RunPerlCode command, though it is a bit complicated, and I plan to make some changes to the internal filter syntax very soon...
But as a less generic command :
Code: [Select]
RunPerlCode(::Select( filter => Songs::MakeFilterFromID(artist=>$::SongID) ))will set the filter to "songs from current artist", you can replace artist by album and a few others.