jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ListBox › if displayMember is 'label', displayMember/valueMember does not work
Tagged: javascript listbox, jQuery ListBox, ListBox
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 9 years, 5 months ago.
-
Author
-
December 17, 2015 at 7:50 pm if displayMember is 'label', displayMember/valueMember does not work #79479
I like to use displayMember / valueMember for jqxListBox as you have an example made here:
http://jsfiddle.net/jqwidgets/QvpMX/However, if I use ‘label’ as valueMember name, it does not work. It costed me hours to find out, why my application did not work until I remarked that I should not use ‘label’. Why is this member name not allowed? Are there other black listed names?
http://jsfiddle.net/1ksdndwe/Best regards,
– baderaDecember 18, 2015 at 8:17 am if displayMember is 'label', displayMember/valueMember does not work #79492Hi badera,
label is displayMember by default. value is valueMember by default. You cannot use valueMember as “label”. This is demonstrated in the examples. I would suggest you next time to look at the examples & documentation in order to learn how to use these widgets.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comDecember 18, 2015 at 12:01 pm if displayMember is 'label', displayMember/valueMember does not work #79511Thanks Peter for the clarification.
However, the main problem is that the API documentation does not point to such things! And in the examples, I do no where find a hint, which says “do not use these names”…
I think it is a a problem of your product that we do not have clear overal descriptions of how things work. We have just a huge amount of samples (which is great) but on the other hand only few words about the functionality. This could be improved!
Please don’t be angry with me about this critic, it is just a suggestion. And I really do love your widgets!!Best regards,
– baderaDecember 18, 2015 at 12:18 pm if displayMember is 'label', displayMember/valueMember does not work #79512Hi badera,
You load the widget from Array. You had to look at just 1 sample called Binding to Array: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxlistbox/listboxlabelandvalue.htm?arctic in order to understand that even when displayMember nad valueMember are not explicitly set, label is the item’s label, value is the item’s value. There is also another very easy approach for binding trough jqxDataAdapter instead of through Array. We have communicated many times so I know that you used jqxDataAdapter before. So in this case, you have to define adapter and set it as source and you will end up with this: http://jsfiddle.net/jqwidgets/08sjqo1p/. Thank you for the documentation point. Yes, everything can be improved and we do it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.