Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi I'm working in JQgrid. for a searching a USER.

If i double click on the particular user in Jqgrid , that particular user name has to reflect on my text box.


could you please help me on this.


its very urgent

C#
jQuery('#' + empData).jqGrid({
            dataType: 'json',
           // url: "Servicelibrary/employeesearch.aspx",
                colNames: ['Employee Number', 'Employee Name'],
                colModel: [
                    { name: 'EmployeeNo', index: 'EmployeeNo', width: 150 ,search:true},
                    { name: 'FirstName', index: 'FirstName', width: 150,search:true }
                ],
                rowNum: 10,
                sortname: 'EmployeeNo',
                viewrecords: true,
                sortorder: "desc",
                gridview:true,
                //searchOnEnter:true,
                //search: true,
                //scroll: true,
                //loadonce: true,
                rowList: [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
                pager: $('#' + pager),

                caption: "List Employee Details"
            });

            $('#' + empData).jqGrid('filterToolbar', ('#' + pager), { stringResult: true, searchOnEnter: false, defaultSearch: 'cn'});
           // $('#' + empData).trigger("reloadGrid", [{ current: true}]);
           // $('#' + empData).jqGrid('navGrid', ('#' + pager), { edit: true, add: true, del: true, search: true, defaults: true });   //, {}, {}, {}, { search: true });
            // $('#' + empData).jqGrid('navGrid', ('#' + pager), { edit: false, add: false, del: false }, {}, {}, {}, { search: true });
            var UserData = eval(jsondata.responseText);
            for (var x = 0; x <= UserData.length; x++) {
             $('#' + empData).addRowData(x, UserData[x]);
            }

           // $('#' + empData).trigger("reloadGrid");
            //$('#' + empData).jqGrid('searchGrid', { multipleSearch: true, multipleGroup: true, sopt: ['eq', 'ne', 'cn', 'bw', 'bn'] });
            //$('#' + empData).trigger("reloadGrid");
            //$('#'+empData).addJSONData(jsondata.responseText);
        }
    }
});
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900