Select Box within JSGrid does not show value until clicked
See original GitHub issueWe are having a display issue. The value of the SELECT control within the Grid is not displaying until the row is clicked. MVC application: public class ReimbursementMethodViewModel { public decimal TRAVEL_REIMBURSEMENT_METH_SEQ { get; set; } public string DESCRIPTION { get; set; } }
VIEW: @model IList<ACBL.Crew.Travel.Web.Models.ReimbursementMethodViewModel>
var methods = @Html.Raw(Json.Encode(@Model));
var db = { loadData: function (filter) { var d = $.Deferred(); $.ajax({ url: ‘@ViewBag.API_URL’ + “TRAVEL_REIMBURSEMENT_TYPES”, type: “GET”, data : filter, dataType: “json” }).done(function (response) {d.resolve(response.value); }); return d.promise();
}
}; $(function (refreshgrid) { $(“#jsGrid”).jsGrid({ inserting: true, editing: true, sorting: false, paging: true, autoload: true, width: “115%”, height: “auto”, controller: db, fields: [ { name: “TRAVEL_REIMBURSEMENT_TYPE_SEQ”, title: “”, type: “number”, width: 30, editing: false, inserting: false }, { name: “DESCRIPTION”, title: “Description”, type: “text”, width: 125, editing: true, inserting: true }, { name: “TRAVEL_REIMBURSEMENT_CODE”, title: “ADP Code”, type: “text”, width: 30, editing: true, inserting: true }, { name: “methods”, title: “Pay Method” , type: “select” , items: methods , valueField: “TRAVEL_REIMBURSEMENT_METH_SEQ” , textField: “DESCRIPTION” , filterValue: function() { return this.items[this.filterControl.val()][this.textField];} }, { type: “control”, deleteButton: true, editButton: true, insertButton: true, editButtonTooltip: “Edit Amount” }, { itemTemplate: function (value,item) { var $result = jsGrid.fields.control.prototype.itemTemplate.apply(this, arguments); var $EditButton = $(“”) .text(“Edit More”) .click(function(e){ location.href = ‘@Url.Action(“Details”, “ReimbursementType”)’ + ‘?’ + “ptypeseq=” + item.TRAVEL_REIMBURSEMENT_TYPE_SEQ; }); return $result.add($EditButton); } } ] }); });
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (6 by maintainers)
@brianDHall I actually just had this issue. 1. Make sure your columns “name” attrib is the same as the “valueField” attrib. 2. Done
thanks, guys