How to pass dropdownlist value to query parameter?

I'm having trouble passing the value selected in the drop down list to a screen query parameter.  Any thoughts?

1 Reply

KS Kalai Selvi Rajendran Syncfusion Team January 25, 2016 02:55 PM UTC

Hi Jeremy,

As you have requested, we can pass the selected value in the DropDownList to the next screen by using the following code snippet

<code>

myapp.BrowseCustomers.Customers_render = function (element, contentItem) {

    var input = $('<input />');

    input.attr('id', 'Customers');

    input.attr('data-role', 'none');

    input.appendTo($(element));

    contentItem.value.oncollectionchange = function (){

        var first = contentItem.children[0];

        var label = first.children[0].valueModel.name;

        var value = first.children[1].valueModel.name;

        if (input.hasClass('e-dropdownlist')){input.ejDropDownList('destroy');}

        input.ejDropDownList({dataSource: contentItem.value.data,

            fields: { text:label,value:value},

            change: function (args) { contentItem.value.selectedItem = contentItem.value.data[args.itemId];} });

}};


myapp.BrowseCustomers.Navigate_execute = function (screen) {

    // Write code here.


    var obj = $("#Customers").ejDropDownList("instance");

    var selectedData = obj.getSelectedValue();

    myapp.showScreen("Navigate", [selectedData]);


};

</code>

If you have any other queries, please let us know.

Regards

Kalai Selvi


Loader.
Up arrow icon