Smart UI Components & Libraries – Grid, Scheduler, Gantt, Kanban for Angular, React, Next.js, Vue, Blazor, JavaScript › Forums › General Discussions › ComboBox › limiting combobox size
- This topic has 4 replies, 2 voices, and was last updated 3 years, 7 months ago by
edwardsmarkff.
-
AuthorPosts
-
April 21, 2022 at 8:26 pm #103094
edwardsmarkff
Participanthello – i am trying to “limit” the total number of characters to just three, but i cannot find a good option to do this. i was able to get this working, but i am going to assume there is a MUCH better way!
https://codepen.io/edwardsmarkf/pen/mdpogEL
also, what is the difference between a combo-box and a multi-combo-input?
https://www.htmlelements.com/demos/input/multi-combo-input/
-
This topic was modified 3 years, 8 months ago by
edwardsmarkff.
April 22, 2022 at 7:56 am #103096admin
KeymasterHi,
1. There is currently no property of the combobox which allows you to limit the number of characters.
2. For the difference between ComboBox & MultiComboInput. ComboBox allows you to display large data sets, has UI virtualization, multiple different selection modes, multiple different dropdown options like resize, multiple auto-complete options, etc. The MultiComboInput’s purpose is to display small collection of items in a dropdown and to display them as tags.Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/April 22, 2022 at 9:04 pm #103099edwardsmarkff
Participantok thanks – is this the best way to limit the number of characters in a combo-box?
https://codepen.io/edwardsmarkf/pen/mdpogEL
window.onload = () => {
. . for ( let results in document.getElementById(“my-smart-combo-box”).getElementsByTagName(‘INPUT’) )
. . {
. . . . let tmp = document.getElementById(“my-smart-combo-box”).getElementsByTagName(‘INPUT’)[results] ;
. . . . if ( (typeof tmp == ‘object’) && tmp.getAttribute(‘class’) == ‘smart-input’)
. . . . {
. . . . . . . . tmp.setAttribute(‘maxlength’, ‘3’);
. . . . . . . . break;
. . . . }
. . }
}-
This reply was modified 3 years, 8 months ago by
edwardsmarkff.
-
This reply was modified 3 years, 8 months ago by
edwardsmarkff.
April 25, 2022 at 6:21 am #103102admin
KeymasterHi,
Only as a temporary workaround such code could be used.
Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/April 25, 2022 at 11:18 pm #103110edwardsmarkff
Participant>>> “Only as a temporary workaround such code could be used.”
does this mean the option may become available?
-
This reply was modified 3 years, 7 months ago by
edwardsmarkff.
-
This topic was modified 3 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.