jQWidgets Forums
jQuery UI Widgets › Forums › React › Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie
This topic contains 7 replies, has 2 voices, and was last updated by Hristo 5 years, 8 months ago.
-
Author
-
October 24, 2019 at 5:53 pm Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107139
Please take a look at the following code:
https://stackblitz.com/edit/react-ts-ew3gyu
Question #1: I’ve tried to incorporate DropDownList component and it’s throwing an error at line 153:
Question #2: Despite above error, I can see the dropdownlist in the window but I want to get rid of the extra space that I’ve highlighted in yellow color in the screenshot below, how can I do this?
Question #3: Once the list is displayed properly, how can I get the value of selected item?
Thanks
October 29, 2019 at 7:41 am Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107176Hello walker1234,
This becomes from the strict definitions of the TypeScript.
You useIGridProps
and instead of this, you try to set source on the jqxDropDownList from another type.
Please, take a look at this example:
https://stackblitz.com/edit/react-ts-gsdc4g
You could see that the IProps extends the IGridProps and IDropDownListProps.About the second question the jqxDropDownList has
autoDropDownHeight
property.On the last question it is better to add a reference for this widget and as on other use its methods to get the selected item.
More details you could find in the API Documentation page.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comOctober 30, 2019 at 5:30 pm Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107196Thanks. Let’s say if I want to have an integer value corresponding to each dropdown character value in the demo you shared:
https://stackblitz.com/edit/react-ts-gsdc4g
For example if I want to fit something like below
<option value=0>Affogato</option> <option value=1>Americano</option> <option value=2>Bicerin</option> <option value=3>Breve</option>
in this part of code so that when a user selects a particular value, a corresponding number gets selected.
<JqxDropDownList width={100} height={20} source={this.state.dropdownlistSource} selectedIndex={0} />
Do I need to define values in
dropdownlistSource
which is defined inside a state ?October 31, 2019 at 8:43 am Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107201Hello walker1234,
Yes, it is similar to the native JavaScript jqxDropDownList.
You could define it directly as this below:dropdownlistSource: [ { value: 0, label: "Affogato" }, { value: 1, label: "Americano" }, { value: 2, label: "Bicerin" }, { value: 3, label: "Breve" } ]
Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comOctober 31, 2019 at 2:19 pm Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107210Ok. And how do I access its value in the following line of code then based on user’s selection :
<JqxDropDownList width={100} height={20} source={this.state.dropdownlistSource} selectedIndex={0} autoDropDownHeight={true}/>
Because, I can’t define
ref
in JqxDropdownlist. When I was not using the dropdownlist but jQXInput, I was able to retrieve its value like this by definingref
:<JqxInput ref={this.myId} width={150} height={23} />
November 1, 2019 at 10:29 am Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107223Hello walker1234,
Could you clarify it?
What is your scenario?Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comNovember 5, 2019 at 3:12 pm Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107246Hello Histro,
My scenario is, basically when a user selects and hits on save or submit button, I want to get its value. For example, if
Affogato
is selected, I want to get0
, similarly, ifBicerin
is selected, I want to get its value which is2
.November 6, 2019 at 11:53 am Error with jQXDropdownlist Type 'IGridSource' is missing the following propertie #107252Hello walker1234,
You could use the
getSelectedItem
method of the jqxDropDownList.
Which provides you an object withvalue
andlabel
member that is what you are looking for.
Please, look at the API Documentation page for more details.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.