jQuery UI Widgets Forums Lists DropDownList dropdownlist to update a grid row data not loading row value

This topic contains 2 replies, has 2 voices, and was last updated by  claudegel 9 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • claudegel
    Participant

    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


    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    claudegel
    Participant

    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(",");

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.