Open AhmadYusoff opened 3 years ago
The jtable definition looks fine, so the problem must be with the json response from the server.
Can you post the server response here for further investigation.
json response from server coding on below:
public JsonResult GetJuiceLists() { try { SelectList listJuice; var sql = "SELECT JUICE_ID,JUICE_NAME FROM JUICE"; listJuice = new SelectList(SqlDbContext.getDropdownList(sql), "Value", "DisplayText"); return Json(new { Result = "OK", Options = listJuice}, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { Result = "ERROR", Message = ex.Message }); } }
I meant, what is the json text arriving at the browser?
I'd expect to see something like
{"Result":"OK","Options":[{"Value":"101","DisplayText":" Paperback"},{"Value":"102","DisplayText":" Hardcover"}]}
@AhmadYusoff You can view the ajax response of '/Fruit/GetJuiceLists' in Network tab under "Developer Tools". Share that response
Hello I am new to jtable and like to improve programming skill but i am stuck on dropdown function and unable to display inside ADD/EDIT form . It come out weird value of dropdown is "undefined" . If i manual hardcore for options of Juice name will not issue and working fine.
Below is my code:
In controller part:
In javascript part :
Can someone has any experience with that issue? Thank you so much.