HomeSeer / Plugin-SDK

Plugin development kit for the 4th major edition of the HomeSeer platform.
https://www.nuget.org/packages/HomeSeer-PluginSDK/
GNU Affero General Public License v3.0
20 stars 4 forks source link

MIssing JUI type for featurepage like ESelectListType.SearchableDropDown #335

Closed stefxx closed 1 year ago

stefxx commented 1 year ago

Environment

HomeSeer

OS

Windows & Linux

HS Version

[v4.2.16.5]

Development

PSDK Version

v1.4.2.0

Language

VB

IDE

VS2019

Dev OS

Windows

Problem

In my plugin I want to create a searchable dropdown in a FeaturePage, like the device/feature selector in HS4 events. But there is no JUI type I can use. In a SettingsPage, I can use something like this: SelectListView(ID, Name, Values, Keys, ESelectListType.SearchableDropDown, Default)

This is the (simplified) code I am currently using:

<div id='myID.par' class='jui-view'>
<label class='jui-select-label'>Select...</label>
<select class='mdb-select md-form jui-input jui-select' id='myID' required onchange="PostBack(this);">
  <option selected disabled value='-1'>Select...</option>
  <option value='1'>Option 1</option>
  <option value='2'>Option 2</option>
</select></div>

Description

I like to use a searchable dropdown in a FeaturePage for a new plugin I am currently developing.

Thanks!

spudwebb commented 1 year ago

I don't understand the problem.. If you want to use a JUI searchable select list in your feature page, you can create the select list like this: mySearchableSelectList = new SelectListView(ID, Name, Values, Keys, ESelectListType.SearchableDropDown, Default);

and then call the ToHtml method to produce the html with the searchable attribute: mySearchableSelectList.ToHtml()

Please elaborate on what you are trying to do, or on what doesn't work

stefxx commented 1 year ago

Hi! Sorry, I guess I forgot to explain why I didn't want to use the default SelectListView but build my own HTML. I want to replicate the Device/Feature select list used in events as much as possible. So I want all (root) Devices to be disabled, like this:

image

Thanks again.

stefxx commented 1 year ago

Never mind, I've found it. Just add searchable="Search..." will make the search work.

<select class='mdb-select md-form jui-input jui-select' id='myID' searchable='Search...' required onchange="PostBack(this);">

Thanks!