jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox How can I search multiple fields?

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • How can I search multiple fields? #54329

    tomitzu
    Participant

    Hi,

    I made a combobox control for client list, but I want to search by client name, phone, and ssn number. But it seems only the client name is being searched. I add custom rendering to display phone and ssn numbers for each client. Please help. Thanks

    Here is my code:

    fields = [{name: 'id'}, {name: 'name'}, {name: 'dba'},{name: 'ssn'}, {name: 'cell'}];
            var result = binddata("accounts/getaccounts", fields);
            
            var dataAdapter = new $.jqx.dataAdapter(result);
            
            $("#jqxSearchAccount").jqxComboBox({source: dataAdapter,searchMode: 'containsignorecase', multiSelect: true, width: '100%',  height:'32px', displayMember: "dba", valueMember: "id",
                renderer: function (index, label, value) {
                        var data = dataAdapter.records;
                        var datarecord = data[index];
                        var imgurl = '../../images/' + label.toLowerCase() + '.png';
                        var img = '<img height="50" width="45" src="' + imgurl + '"/>';
                        
                        var ssn = '';
                        if(datarecord.ssn != 'null'){
                            ssn +=  'SSN: '+ datarecord.ssn;
                        }
                        
                        var table = '<table style="min-width: 150px;"><tr><td style="width: 55px;" rowspan="2">' + img + '</td><td>' + datarecord.dba +'</td></tr><tr><td>'+ssn+ ' Phone: '+ datarecord.cell+'</td></tr></table>';
                        return table;
                    }
            });
    How can I search multiple fields? #54331

    Dimitar
    Participant

    Hello tomitzu,

    Unfortunately, jqxComboBox does not offer this functionality. If it suits your purpose, you may try jqxGrid, which features more advanced filtering.

    Best Regards,
    Dimitar

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

    How can I search multiple fields? #54335

    tomitzu
    Participant

    I see. Okay. Thanks for your reply.

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

You must be logged in to reply to this topic.