jQWidgets Forums

This topic contains 2 replies, has 2 voices, and was last updated by  Nadezhda 10 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Getting Value of Multiple-Value jqxInput #61713

    AJRames
    Participant

    Hi all,
    I am facing a problem regarding getting the value of a jqxInput with multiple values.

    I tried using:
    $('#inputDiv').val(),
    $('#inputDiv').jqxInput('val')
    and (due to the fact, that the data is also stored in the data value of the html element) I also tried
    $('#inputDiv').val().value.

    Unfortunately none of my attempts receives the whole data of the input – I only receive the last entered value.

    Here is my code:

    $("#auftragsgrund").jqxInput({
                    height: 25, width: 250, displayMember: "CostCenterNumber", valueMember: "CostCenterNumber", source: function (query, response) {
                        var item = query.split(/,\s*/).pop();
                        // update the search query.
                        $("#auftragsgrund").jqxInput({ query: item });
                        response(costCenterNumbers);
                    },
                    renderer: function (itemValue, inputValue) {
                        var terms = inputValue.split(/,\s*/);
                        // remove the current input
                        terms.pop();
                        // add the selected item
                        terms.push(itemValue);
                        // add placeholder to get the comma-and-space at the end
                        terms.push("");
                        var value = terms.join(", ");
                        return value;
                    }
                })

    This input should auto-complete the values based on a list (this works) and the user should be able to enter multiple values comma seperated.

    Could you help me?

    Best regards

    Getting Value of Multiple-Value jqxInput #61715

    AJRames
    Participant

    sorry for the double post – I just found a property that contains the whole input.

    It’s $('#inputDiv').jqxInput()[0].value.

    Is there a better way to get the value?

    Getting Value of Multiple-Value jqxInput #61725

    Nadezhda
    Participant

    Hello AJRames,

    Here is an example which shows how to get all values using val() from input: http://jsfiddle.net/a2f29jpy/. Please, make sure your jQWidgets files are updated to version 3.5.0.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.