question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select Box within JSGrid does not show value until clicked

See original GitHub issue

We 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:closed
  • Created 7 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Adondrielcommented, Jul 13, 2016

@brianDHall I actually just had this issue. 1. Make sure your columns “name” attrib is the same as the “valueField” attrib. 2. Done

0reactions
PlatoArestoluscommented, Nov 17, 2019

thanks, guys

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't get a select box value until is clicked - Stack Overflow
I need the year value when the user click another selectBox (month). Only if previously the user clicks in the year selectBox I...
Read more >
Documentation - jsGrid
A boolean value specifies whether to show grid header or not. ... select. Select field renders <select> control in filter, inserting and editing...
Read more >
jsgrid - Options
Clicking in any other row (suppose the checkbox is not clicked) deselects all rows and selects the current row. This option is only...
Read more >
wiki:options - jqGrid
Property Type Can be changed? ajaxGridOptions object Yes ajaxSelectOptions object Yes altclass string Yes. Requires reload
Read more >
Placeholders - The jQuery replacement for select boxes
The placeholder value will be displayed until a selection is made. ... For multi-selects, you must not have an empty <option> element:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found