jQuery UI Widgets › Forums › Lists › ListBox › How to work with it if an item label property contains other language?
Tagged: jqxListBox, language, ListBox, removeItem
This topic contains 5 replies, has 2 voices, and was last updated by andrewgo 10 years, 1 month ago.
-
Author
-
September 23, 2014 at 7:22 am How to work with it if an item label property contains other language? #59887
$(“.listbox”).on(‘dragEnd’, function (event) {
…
“.(‘removeItem’, ‘итем1’), “.(‘getItem’, ‘итем1’) both of them is not working.How can it be? I don’t want to use the listbox value property because i store some json there.
Thank you.
September 23, 2014 at 8:21 am How to work with it if an item label property contains other language? #59894Hello andrewgo,
In the following example you can learn how to use “removeItem” to remove an item in another language: http://jsfiddle.net/fs3e2pwq/.
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/September 23, 2014 at 9:19 am How to work with it if an item label property contains other language? #59902If i use a source like this
var source = [
{label:”итем1″,value:{table:”foo”}},
{label:”итем2″,value:{table:”foo”}},
{label:”итем3″,value:{table:”foo”}},
{label:”итем4″,value:{table:”foo”}},
{label:”итем5″,value:{table:”foo”}}];The button and the code below are not working:
$(“#jqxListBox”).on(“dragEnd”, function (event) {
$(“#jqxListBox”).jqxListBox(‘removeItem’, event.args.label);
}
without any error messages.September 23, 2014 at 9:25 am How to work with it if an item label property contains other language? #59904Though it’s not working with english labels too.
September 23, 2014 at 2:12 pm How to work with it if an item label property contains other language? #59923Hi andrewgo,
If you use method “removeItem” then you have to pass the object returned by the “getItem” method or String – the value of an item (not the label).
Here is an example with “removeItem” method that removes an item in another language:<!DOCTYPE html> <html lang="en"> <head> <meta name="keywords" content="jQuery DropDownList, List, ListBox, Popup List, jqxDropDownList, jqxListBox, List Widget, ListBox Widget, DropDownList Widget" /> <meta name="description" content="The jqxListBox represents a widget that contains a list of selectable items." /> <title></title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script src="../../jqwidgets/jqxdragdrop.js"></script> <script type="text/javascript"> $(document).ready(function () { var source = [ { label: "итем1", value: "валуе1" }, { label: "итем2", value: "валуе2" }, { label: "итем3", value: "валуе3" }, { label: "итем4", value: "валуе4" }, { label: "итем5", value: "валуе5" } ]; // Create a jqxListBox $("#jqxListBox").jqxListBox({ source: source, theme: 'energyblue', width: '200px', height: '250px', allowDrag:true, selectedIndex: 3 }); $('#btn').on('click', function (event) { $("#jqxListBox").jqxListBox('removeItem', "валуе1"); }); }); </script> </head> <body> <div id='content'> <div id='jqxListBox'> </div> <input style="margin-top: 20px;" type="button" id="btn" value="Remove 'итем1' from the list" /> </div> </body> </html>
Best Regards,
NadezhdajQWidgets team
http://www.jqwidgets.com/September 25, 2014 at 5:50 am How to work with it if an item label property contains other language? #60017That was helpful, thanks!
-
AuthorPosts
You must be logged in to reply to this topic.