I have a dropdown field that uses a source that suplies both a display name and a value (ID). How can I fetch them upon an update/edit?
Upon ‘cellendedit, I need to fetch the value (ID) for the displayed name…..
Thanks!!
p.s. the event.args does not include an .item property so cannot see the display name AND the value.
the grid column looks like:
{ text: ‘Client’, datafield: ‘client’, columntype: ‘dropdownlist’, filtertype: ‘checkedlist’, cellsalign: ‘left’, width: 150,
createeditor: function (row, column, editor) {
editor.jqxDropDownList({ source: clients, displayMember: “client”, valueMember: “clientID” });
}
and the update routine:
$(“#jqxgrid”).bind(‘cellendedit’, function (event) {
var args = event.args;
$(“#cellendeditevent”).html(“Event Type: cellendedit, Column: ” + args.datafield + “, Row: ” + (1 + args.rowindex) + “, Value: ” + args.value);
var id = $(“#jqxgrid”).jqxGrid(‘getcellvalue’, event.args.rowindex, ‘donationID’);
$.ajax({
url: “DataProvider.aspx”,
dataType: ‘json’,
data: { ‘fn’: ‘updateDonation’, ‘donationID’: id, ‘column’: args.datafield, ‘value’: args.value },
async: false,
success: function (json) {
donations = json;
}
});
});