jQuery UI Widgets › Forums › Angular › Angular 2 ListBox
Tagged: angular 2, Angular2, angularjs, angularjs 2, jqwidgets, jqwidgets and angular 2, jqwidgets typescript, typescript
This topic contains 2 replies, has 3 voices, and was last updated by majidparsa 4 years, 8 months ago.
-
AuthorAngular 2 ListBox Posts
-
Hi,
I have Created a ListBox with Data source belowand in the Button Click Event i trying to change the Datasource of the listbox, but it is not happening
below is the code
@ViewChild(‘listBoxReference’) myListBox: jqxListBoxComponent;
let addRemoveColumnsSource: any = [];
let settings: jqwidgets.ListBoxOptions = {checkboxes: true, scrollBarSize: 5}private columns: any = [
{
“text”: “Bill #”,
“dataField”: “Bill”
},
{
“text”: “Period”,
“dataField”: “Period”
},
{
“text”: “Days”,
“dataField”: “Days”
}
];this.Columns.forEach(function (data) {
var item = {};
item[“label”] = data.text;
item[“value”] = data.dataField;
item[“checked”] = true;
addRemoveColumnsSource.push(item);
});this.settings.source = addRemoveColumnsSource;
this.myListBox.createWidget(this.addRemoveColumnsListSettings);Button Click Event:
Clk(): void{
this.columns: any = [
{
“text”: “Bill Date”,
“dataField”: “Bill Date”
},
{
“text”: “Bill Amount (USD)”,
“dataField”: “Bill Amount”
},
{
“text”: “Current Charges (USD)”,
“dataField”: “Current Charges”
},
{
“text”: “Previous Balance (USD)”,
“dataField”: “Previous Balance”
},
{
“text”: “Late Fee (USD)”,
“dataField”: “Late Fee”
},
{
“text”: “Utility”,
“dataField”: “Utility”
},
{
“text”: “Images”,
“dataField”: “Image”
}
];let listSrc: any = [];
for (var i = 0; i < this.columns.length; i++) {var item = {};
item[“label”] = this.columns.text;
item[“value”] = this.colums.dataField;
listSrc.push(item);
}this.myListBox.source = listSrc;
}But after change the source in the click event the data to the listbox is not binding.
Could you please suggest the solution
Thanks in Advance.
Hi fresher,
this.myListBox.source = listSrc will do nothing. You should use the setOptions method and pass a JSON object to it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi
I have a problem with listbox. when i use listbox with rtl set to true and filtering the filter input remains in ltr direction and has positioning base on ltr
how solve this problem?
Thanks -
AuthorPosts
You must be logged in to reply to this topic.