jQuery UI Widgets › Forums › Lists › DropDownList › dropdownlist to update a grid row data not loading row value
Tagged: Cell, checkbox, checkboxes, checkItem, DropDownList, edit, editing, grid, jqxDropDownList, jqxgrid, pop-up, popup
This topic contains 2 replies, has 2 voices, and was last updated by claudegel 9 years, 9 months ago.
-
Author
-
Hi,
I have a grid with a popupwindow to edit/update each row. If I add or edit data in a row, when I edit another row then the dropdownlist in the popup is keeping the selected value of the last time I open the dropdownlist. It is not loading the value of the row I want to edit.
What should I do to pass the cell row value to the dropdownlist before openning the popup window to edit that row. The dropdownlist have checkboxes: true as parameter.// get the clicked row's data and initialize the input fields. var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); $("#nofacture").val(dataRecord.no_facture); $("#nolot").val(dataRecord.no_lot); $("#codeprod").val(dataRecord.code_prod); --> $("#spec_list").jqxDropDownList('val',dataRecord.probleme); $("#quantite").val(dataRecord.qtt); $("#cause").val(dataRecord.descrip); // show the popup window. $("#lepopup").jqxWindow('open'); }
$(“#spec_list”).jqxDropDownList is keeping the value of the last time I’ve selected item in the drop down list and the values of the selected row are not checked
how do I pass de selected row value to the dropdownlist
Hello claudegel,
If checkboxes are enabled, you would have to set the dropdownlist’s selection with the checkItem method. If the cell contains comma-separated values, you can split them and call checkItem multiple times.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Ok it work like this:
I’d to first uncheckall before using checkitem$("#spec_list").jqxDropDownList('uncheckAll'); var check = dataRecord.probleme; var checkit = check.split(","); for (i = 0; i < checkit.length; i++) { $("#spec_list").jqxDropDownList('checkItem', checkit[i]); }
maybe I can use directly
var checkit = dataRecord.probleme.split(",");
-
AuthorPosts
You must be logged in to reply to this topic.