jQuery UI Widgets Forums Lists DropDownList Defaulting checked based on JSON data

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 7 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • sjkcwatson
    Participant

    Is there a way to default the value to checked when the USED field in the datasource is = TRUE either as the drop down is built or by looping through after?

          var IncCodeurl = "WebServices/OriasWcfService.svc/LookupIncCodeCAPAList?CAPAID=" + selectedCAPAID + "&IncID=" + selectedModuleItemNumberStr + "&LPID=" + vLPID; //pass 0 for capaid on add new, but this is edit
                var IncCodeListsource = {
                    datatype: "json",
                    datafields: [
                        { name: 'CodeDetailsID' },
                        { name: 'GroupDescription' },
                        { name: 'CodeDescription' },
                        { name: 'USED' }
                    ],
                    id: 'CodeDetailsID',
                    url: IncCodeurl,
                    async: false
                };
                var IncCodeListdataAdapter = new $.jqx.dataAdapter(IncCodeListsource);
                $("#jqxWidget_IncCodeList").jqxDropDownList({ width: 775, source: IncCodeListdataAdapter, displayMember: "CodeDescription", valueMember: "CodeDetailsID", checkboxes: true, checked: true });
                var IncCodeitems = $("#jqxWidget_IncCodeList").jqxDropDownList('getItems');

    ivailo
    Participant

    Hi sjkcwatson,

    There is no option to set the checkboxes when you load the widget, but you can set them immediatly after by looping with $("#jqxDropDownList").jqxDropDownList('checkItem', item );.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.