zet-lib 1.0.66 → 1.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/zRoute.js +4 -3
  2. package/package.json +1 -1
package/lib/zRoute.js CHANGED
@@ -2861,16 +2861,17 @@ zRoute.generateJS = (req, res, MYMODEL, relations, zForms = '', data = {}) => {
2861
2861
  for (let qq in MODEL_TABLE.widgets) {
2862
2862
  //check if have dropdown_multi
2863
2863
  if (MODEL_TABLE.widgets[qq].name == 'dropdown_multi') {
2864
- scriptForm += ` $("#body-${keys}").on("click", "#dropdownadd${qq}",function () {
2864
+ scriptForm += `$("#body-${keys}").on("click", "#dropdownadd${qq}",function () {
2865
2865
  let elm = $(this).siblings("#${qq}");
2866
2866
  var val = elm.val();
2867
2867
  if(val == ""){
2868
2868
  alert("Please select data");
2869
2869
  return false;
2870
2870
  }
2871
+ var lengthOfItem = $(this).closest("tr").attr("data-id");
2871
2872
  let text = elm.find("option:selected").text();
2872
2873
  var count = $(this).parent().parent().find(".span${qq}").length;
2873
- var data = "<span class='span${qq}' > "+(count+1)+". <input type='hidden' name='${MODEL_TABLE.table}[${qq}][]' value='"+val+"' /> " + text +" <img class='tabler-icons icons-filter-danger pull-right' src='/assets/icons/trash-filled.svg' onclick='$(this).closest(\`span\`).remove();' title='Delete' /> <br></span>";
2874
+ var data = "<span class='span${qq}' > "+(count+1)+". <input type='hidden' name='${MYMODEL.table}[${keys}]["+lengthOfItem+"][${qq}]["+count+"]' value='"+val+"' /> " + text +" <img class='tabler-icons icons-filter-danger pull-right' src='/assets/icons/trash-filled.svg' onclick='$(this).closest(\`span\`).remove();' title='Delete' /> <br></span>";
2874
2875
  $(this).parent().parent().find("#dropdownbox${qq}").append(data);
2875
2876
  $(this).siblings("#${qq}").val("");
2876
2877
  });${Util.newLine}`
@@ -2903,7 +2904,7 @@ $("#body-${keys}>tr").each(function (index, tr) {
2903
2904
  $(input).removeAttr("name");
2904
2905
  $(input).attr("name",dataname+"["+index+"]["+$(input).data("name")+"]");
2905
2906
  }
2906
- });
2907
+ });
2907
2908
 
2908
2909
  var textareas = $(tr).find("textarea");
2909
2910
  textareas.each(function (i,input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"