Closed darryl-tan closed 7 months ago
@darryl-tan Thank you for utilizing kuc and the issue registration. Let me confirm following. You use kuc.min.js of kuc 1.16.0 version? (not the latest version v1.17.0)
@darryl-tan How's this going? If there is still problem, could you let us know.
its ok now .dont use kuc=kucs[""],it can run.
---Original--- From: @.> Date: Wed, May 1, 2024 10:34 AM To: @.>; Cc: @.**@.>; Subject: Re: [kintone-labs/kintone-ui-component] I can't find const Kuc =Kucs['1.16.0']; in JS (Issue #1537)
@darryl-tan How's this going? If there is still problem, could you let us know.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
@darryl-tan Thank you for the reply, glad to hear it's working now. I will close the issue. If you have any other problems or requests, please register new issue. Thank you!
url:https://cybozu.dev/ja/kintone/tips/development/customize/validation-and-assistance/use-kintone-ui-component-v1-for-dynamic-dropdown/#label-dropdown
I type code like this:`(() => { 'use strict';
const prefectures = { 北海道地方: ['北海道'], 東北地方: ['青森', '岩手', '宮城', '秋田', '山形', '福島'], 関東地方: ['東京', '茨城', '栃木', '群馬', '埼玉', '千葉', '神奈川'], 中部地方: ['新潟', '富山', '石川', '福井', '山梨', '長野', '岐阜', '静岡', '愛知'], 近畿地方: ['京都', '大阪', '三重', '滋賀', '兵庫', '奈良', '和歌山'], 中国地方: ['鳥取', '島根', '岡山', '広島', '山口'], 四国地方: ['徳島', '香川', '愛媛', '高知'], 九州地方: ['福岡', '佐賀', '長崎', '大分', '熊本', '宮崎', '鹿児島', '沖縄'] };
const setDropdownItems = (event, dropdown) => { const regionValue = event.record.地方.value; if (!regionValue) return; const items = [{label: '-----', value: ''}]; prefectures[regionValue].forEach((prefecture) => { items.push( { label: prefecture, value: prefecture } ); });
};
let dropdown;
kintone.events.on(['app.record.create.show', 'app.record.edit.show'], (event) => { const prefectureValue = event.record.都道府県.value; const Kuc = Kucs['1.16.0']; dropdown = new Kuc.Dropdown({ label: '都道府県', items: [] });
});
kintone.events.on(['app.record.create.change.地方', 'app.record.edit.change.地方'], (event) => { setDropdownItems(event, dropdown); dropdown.value = ''; event.record.都道府県.value = ''; return event; });
kintone.events.on(['app.record.create.submit', 'app.record.edit.submit'], (event) => { const prefectureValue = event.record.都道府県.value; if (!prefectureValue) { event.error = '都道府県を選択してください'; } return event; }); })();` and I upload kuc.min.js ,and then upload sample.js(code 👆),but error is :undefined ,const Kuc = Kucs['1.16.0']; Kuc is undefined. what can i do? pls help me .