jQuery UI Widgets Forums Angular Angular 2 ListBox

This topic contains 2 replies, has 3 voices, and was last updated by  majidparsa 4 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Angular 2 ListBox #88320

    fresher
    Participant

    Hi,
    I have Created a ListBox with Data source below

    and 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.

    Angular 2 ListBox #88321

    Peter Stoev
    Keymaster

    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 Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Angular 2 ListBox #107891

    majidparsa
    Participant

    Hi
    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

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.