by heribertolugo » Sun Oct 02, 2022 6:56 pm
I'm having trouble using the dropdown. I see a property called dataSource, in which ive seen used throughout MM files. I looked through the dropdown source and noticed it can only be set to be a list of string, or object (in which the toString method is called on). so my questions/issues are as follows:
- Can i add items and specify a value member and a text member? so that the dropdown will display one thing, but each items actual value is something else?
- i have tried to set the datasource to an array of string and then a StringList, but doing so in either way causes an exception of "addEventListener function not found! Event focuschange". what am i doing wrong?
- i also tried to instead add items using , but i still get the same exception as above. i should probably note now that the params are set
Code: Select all
data-init-params="{readOnly: true, preload: true}"
as indicated required by the API. i also tried to attach a function to focuschange Code: Select all
mydropdown.controlClass.localListen(mydropdown, 'focuschange', myFunc);
event to see if that fixes the issue (even though i didnt see that done in MM files), and that did not change anything.
- speaking of params, where are these defined or outlined? i saw a dropdown with
Code: Select all
data-init-params="{readOnly: true, dbFunc:'getStringList', dbFuncParams: {category: 'PlayNowActions', includeDefault: true}, preload: true}"
(pnl_PlaybackRules), but i could not find a reference to any of those params anywhere in the code. i looked in dropdown source, control source and pnl_PlaybackRules.js. how do i know what params are available, as they are not mentioned in the API?
- are custom params possible? if so, how would i access them in code?
basically i am trying to populate the dropdown through code, instead of html. and i would like to know more info about the params. i did find a handful or params in source such as resizable and hasSplitters, but really wish they would be mentioned in the API.
I'm having trouble using the dropdown. I see a property called dataSource, in which ive seen used throughout MM files. I looked through the dropdown source and noticed it can only be set to be a list of string, or object (in which the toString method is called on). so my questions/issues are as follows:
[list=1]
[*]Can i add items and specify a value member and a text member? so that the dropdown will display one thing, but each items actual value is something else?
[*]i have tried to set the datasource to an array of string and then a StringList, but doing so in either way causes an exception of "addEventListener function not found! Event focuschange". what am i doing wrong?
[*]i also tried to instead add items using [code]mydropdown.controlClass.addValue[/code], but i still get the same exception as above. i should probably note now that the params are set [code]data-init-params="{readOnly: true, preload: true}"[/code] as indicated required by the API. i also tried to attach a function to focuschange [code]mydropdown.controlClass.localListen(mydropdown, 'focuschange', myFunc);[/code] event to see if that fixes the issue (even though i didnt see that done in MM files), and that did not change anything.
[*]speaking of params, where are these defined or outlined? i saw a dropdown with [code]data-init-params="{readOnly: true, dbFunc:'getStringList', dbFuncParams: {category: 'PlayNowActions', includeDefault: true}, preload: true}"[/code] (pnl_PlaybackRules), but i could not find a reference to any of those params anywhere in the code. i looked in dropdown source, control source and pnl_PlaybackRules.js. how do i know what params are available, as they are not mentioned in the API?
[*]are custom params possible? if so, how would i access them in code?
basically i am trying to populate the dropdown through code, instead of html. and i would like to know more info about the params. i did find a handful or params in source such as resizable and hasSplitters, but really wish they would be mentioned in the API.