本帖最后由 忘语吧 于 2024-6-4 12:00 编辑
参考这个后也不行
https://gcdn.grapecity.com.cn/showtopic-152939-1-1.html
绑定的这个方法里面(spdMagn_ComboSelChange ),获取不到LvMagn的值。
- const [LvMagn, setLvMagn] = useState<any>([]);
- const [spread, setSpread] = useState<any>(null);
- useEffect(() => {
- Promise.resolve().then(() => getLvMarginList());
- }, []);
- useEffect(() => {
- if (spread) {
- spread.bind(GC.Spread.Sheets.Events.ValueChanged, spdMagn_ComboSelChange);
- }
- }, [spread]);
- const spdMagn_ComboSelChange = (e, info) => {
- console.info("aaa", LvMagn);
- };
- const getLvMarginList = async () => {
- getIniByCmbSiKyok({
- oSClientInfo: oSClientInfo,
- methodName: 'MRGNKBN',
- }).then((res) => {
- let marginList = res.loOListDat;
- setLvMagn(marginList);
- });
- };
复制代码
|
|