I have created one grid using jqWidget. I'm trying to put the drop-down list in the 7th column of jqxgrid. My code is as follows. I can't get the expected output.
// Data which I want to get in dropdownlist
var drpSource = [
{ id: 1, name: "Edit" },
{ id: 2, name: "SendMail" }
];
// This is particular 'column' part of my grid
columns: [
{ dataField: 'user_name', text: 'Username', },
{ dataField: 'first_name', text: 'First Name', },
{ dataField: 'last_name', text: 'Last Name', },
{ dataField: 'email', text: 'Email', width: 300 },
{ dataField: 'register_dt', text: 'Registered Date', cellsformat: 'MM/dd/yyyy', },
{ dataField: 'expiration_dt', text: 'Expiry Date', cellsformat: 'MM/dd/yyyy', },
{
width: 100, autoshowfiltericon: false, dataField: 'drpfunction', text: "Function", columntype: 'dropdownlist',
createeditor: function (row, cellvalue, editor) {
editor.jqxDropDownList({
source: drpSource,
displayMember: 'name',
valueMember: 'id',
filterable: false,
placeHolder: 'Choose…',
autoDropDownHeight: true
});
},
initeditor: function (row, cellvalue, editor) {
editor.jqxDropDownList('selectItem', cellvalue);
}
}
Am I missing anything?
Note: Column has been created successfully, Although it's blank.