Skip to content

Commit

Permalink
fix: update correct subdept dropdown when dept value changes
Browse files Browse the repository at this point in the history
previously the jquery selector was always finding / affecting the
"first" subdept dropdown in the table.  but it should find/affect the
"current row" subdept dropdown instead

Refs: #1225
  • Loading branch information
Lance Edgar committed Jun 13, 2024
1 parent 84a8101 commit 94788f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fannie/item/productList.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ var productList = (function($) {
var departmentChanged = function(event) {
var deptSelect = event.target;
var dept = $(deptSelect).val();
var subdepts = subdeptMap[dept];

// update available subdepts
var obj = subdeptMap[dept];
var td = $('.td_subdept');
td.find('select')[0].remove();
drawKeyValSelect(td.parents('tr:first'), 'td_subdept', 'in_subdept', obj);
// replace dropdown to update available subdepts
var tr = $(deptSelect).parents('tr:first');
tr.find('.td_subdept select')[0].remove();
drawKeyValSelect(tr, 'td_subdept', 'in_subdept', subdepts);
};

var drawTupleSelect = function(elem, cell, field, obj) {
Expand Down

0 comments on commit 94788f7

Please sign in to comment.